Display array data in one row
Hello ---
I have an array of data, I would like to be displayed all the data in one row.<tr></tr>, how to do this?
If I use <h:table> <column></column></h:table>, it will display different rows.
Thanks!
Ben
Populate the components in the backingbean. Try something like:
JSF<h:panelGrid binding="#{myBean.grid}" />MyBeanprivate List arrayOfData;
private HtmlPanelGrid grid; // + getter + setter
private void populateGrid() {
grid = new HtmlPanelGrid();
grid.setColumns(arrayOfData.size());
for (Iterator iter = arrayOfData.iterator(); iter.hasNext();) {
Object value = iter.next();
HtmlOutputText text = new HtmlOutputText();
text.setValue(value);
grid.getChildren.add(text);
}
Similar Messages
-
How to display Column data in one row
Hello,
I have one Employee with 4 effective date displayed in one column. Effective date is drived by Reason of : New Hire, Rehire, Transfer etc.
I want to show the effective dates for one reason in one single row. For example a person was rehired 4 times it will show as
1006555 6/12/2006 1/2/2007 6/11/2007 5/12/2008 12/29/2008 5/17/2010
It's currntly showing as:
AUDITEFFECTIVEDATE_3
6/12/2006
1/2/2007
6/11/2007
5/12/2008
5/17/2010Well that's a little tougher... For a solution to work, you're going to need to find a way to differentiate between the the specific hiring events. Without seeing what data is available, I'd say start looking at the use of running totals... or in this case a running count.
Set it up to reset on EmployeeID and count each "event", incrimenting up with each instance.
Then your formula would look more like this...
IF {EventType} = "Rehire" AND {#RTotal1} = 1 THEN AUDITEFFECTIVEDATE_3
IF {EventType} = "Exit" AND {#RTotal1} = 1 THEN AUDITEFFECTIVEDATE_3
IF {EventType} = "Rehire" AND {#RTotal1} = 2 THEN AUDITEFFECTIVEDATE_3
IF {EventType} = "Exit" AND {#RTotal1} = 2 THEN AUDITEFFECTIVEDATE_3
IF {EventType} = "Rehire" AND {#RTotal1} = 3 THEN AUDITEFFECTIVEDATE_3
IF {EventType} = "Exit" AND {#RTotal1} = 3 THEN AUDITEFFECTIVEDATE_3
IF {EventType} = "Rehire" AND {#RTotal1} = 4 THEN AUDITEFFECTIVEDATE_3
IF {EventType} = "Exit" AND {#RTotal1} = 4 THEN AUDITEFFECTIVEDATE_3
This issue then becomes an issue of space on the report. You end up wasting 1/2 of your horizontal space trying to allot for one odd ball... You'll also get to re-work the report if the same employee goes for rounds 5, 6 or 7...
HTH,
Jason -
Two rows as one display the data in one row
Hello All,
I would like to have data of two rows put in one as:
Lets say the data is like this:
SELECT * FROM TEST;
COL1 COL2 COL3 C
1.5 3 1 M
2 1 C
2.5 2 C
3.5 2 M
4.5 3 M How do i get the output as :
COL1 COL2 COL3 COL4 COL5
1.5 3 1 M 2
2.5 2 C 3.5
4.5 3 M If there are two rows with same value in Col3, then col5(a new dummy column in select stmt) the second row's col2 should be disaplyed in Row 1.
Can we do it in a Select Statement ?
Regds,
AmkotzA try :
SQL> select * from Amkotz;
COL1 COL2 COL3 C
1,5 3 1 M
2 1 C
2,5 2 C
3,5 2 M
4,5 3 M
SQL> select a.col1,
2 a.col2,
3 a.col3,
4 a.col4,
5 max(decode(a.rowid,b.rowid,null,b.col2)) keep (dense_rank last order by a.col1,a.col2) as col5
6 from (select Amkotz.*, row_number() over (partition by col3 order by col1,col2) rn from Amkotz) a, Amkotz b
7 where a.rn=1
8 and a.col3=b.col3
9 group by a.col1,
10 a.col2,
11 a.col3,
12 a.col4;
COL1 COL2 COL3 C COL5
1,5 3 1 M 2
2,5 2 C 3,5
4,5 3 M Nicolas. -
Hello,
Tell Me how i can show a single column data in one row.
10
20
30
To
10,20,30If you are OK with displaying comma separated list or column data you could:
SQL> select ltrim(sys_connect_by_path(ename,','),',') ename_list
2 from (
3 select ename,
4 row_number() over(order by 1) rn,
5 count(*) over() cnt
6 from emp
7 )
8 where rn = cnt
9 start with rn = 1
10 connect by rn = prior rn + 1
11 /
ENAME_LIST
SMITH,ALLEN,WARD,JONES,MARTIN,BLAKE,MILLER,SCOTT,KING,TURNER,ADAMS,JAMES,FORD,CLARK
SQL> To display as separate columns you would need to either know number of rows:
SQL> select min(case rn when 1 then ename else null end) ename1,
2 min(case rn when 2 then ename else null end) ename2,
3 min(case rn when 3 then ename else null end) ename3,
4 min(case rn when 4 then ename else null end) ename4,
5 min(case rn when 5 then ename else null end) ename5,
6 min(case rn when 6 then ename else null end) ename6,
7 min(case rn when 7 then ename else null end) ename7,
8 min(case rn when 8 then ename else null end) ename8,
9 min(case rn when 9 then ename else null end) ename9,
10 min(case rn when 10 then ename else null end) ename10,
11 min(case rn when 11 then ename else null end) ename11,
12 min(case rn when 12 then ename else null end) ename12
13 from (
14 select ename,
15 rownum rn
16 from emp
17 )
18 /
ENAME1 ENAME2 ENAME3 ENAME4 ENAME5 ENAME6 ENAME7 ENAME8 ENAME9 ENAME10 ENAME11 ENAME12
SMITH ALLEN WARD JONES MARTIN BLAKE CLARK SCOTT KING TURNER ADAMS JAMES
SQL> or use dynamic SQL.
SY. -
Report to display (actuals data from one cube and plan from another)
Hi Gurus,
I have a requirement in reporting to display actual data from one cube and plan data from a different one.
The example below might give a clear picture of the requirement.
rows has key figures and columns = months
Jan | Feb | Mar | Apr | May | Jun ... ....
GrossSales
Net Sales
Now if I run the report for Current month (Apr), then for the months of (Jan, Feb and Mar) i need to get the data from CUBE1 and for the remaining months (Apr thru Dec) from CUBE2.
Similarly when i run the report next month(may),
then (data for Jan, Feb, Mar, Apr from CUBE1)
and ( May thru Dec from CUBE2)
Any suggestions.
Thanks in Advance
KumarHi Henry,
We alreadey have a multi provider which includes
FinDat Cube(CUBE1) for actuals and Comm.Goals cube (CUBE2) for plan.
So you suggest that we have two versions of key figure for actual and plan.
ie. each KF will have two versions.
actuals = (version 10, FiscPer<curr.mnth, key figure, acutals cube)
Plan = (version 20, FiscPer>=curr.mnth, key figure, comm.goals cube)
eg:
Jan | Feb | Mar | Apr | May | Jun ...
GrossSales(Act)
GrossSlaes(Plan)
Net Sales(Acutal)
Net Sales(Plan)
Correct me if I am wrong.
the report has a lot of key figures, having two versions for each kf will be confusing.
the user would like to see
Jan.....| ...Feb |..Mar |..Apr.....| May |
GrossSales Act Value|Act.V |Act.V| PlanVal|PlanVal|
Net Sales
where Act.Value is from CUBE1
Plan Value is from CUBE2
Thanks
Kumar -
Need to split data from one row into a new row redux
Hi folks,
I asked this question about eight months ago (see thread https://discussions.apple.com/message/23961353#23961353) and got an excellent response from forum regular Wayne Contello. However, I need to perform this operation again and when I attempted it recently, I am now greeted with a yellow warning triangle. Clicking it shows "This formula can’t reference its own cell, or depend on another formula that references this cell."
What I'm trying to do is the following:
I have an excel file that keeps track of members of a social group. The file places each member "unit" on a single row. The unit can be a single person or a couple. Columns are labeled "First1" "Last1" "Hometown1" "B-day1" while the second member of the unit is identified in columns like "First2" "Last2" etc.
What I'd like to do is duplicate those rows with two people (which I'll do by hand) but have a way of deleting the "xxxx2" data from one row and the "xxxx1" data from the duplicate row.
Wayne's illustrated solution was to create a blank sheet and enter the following formula in cell A2:
=OFFSET(Input Data::$A$2, INT((ROW()−2)÷2), COLUMN()−1+IF(MOD(ROW()−2, 2)=0, 0, 4)), which apparently worked fine for me last year but now is sending up an error flag. When I look at the formula, there is no clue except that which I quoted above.
Can anyone (or hopefully Wayne) take a second look at this and help me out? I can't imagine that it's a problem with using the newer version of Numbers, but who knows? I'm using version 3.2 (1861), which is the "new" Numbers.
Any help would really be appreciated.
Thanks!
-TodHi Tod,
The error message "This formula can’t reference its own cell, or depend on another formula that references this cell." may be because your table may be different from the one you were using for Wayne's solution. Numbers has Header Rows, Footer Rows and Header Columns. Such Headers in tables exclude themselves from formulas. Excel does not recognise them as headers. What table are you using now?
A screen shot of (the top left portion of) your table or a description of what you see under Menu > Table will help.
Regards,
Ian. -
How to display all data on one page in web app
Hello.
So I have web app JSF (IceFaces framework) + JBoss all Crystal Report working perfectly. So I have page with Crystal Report tags (e.g.
<bocrv:reportPageViewer reportSource="#{crystalReport.reportPath}" ...
in this report I have table with some data (data from DB) and I want to display this data on one page. Unfortunately now this data are moving to the next page and unfortunately I even donu2019t know how switch to the next page (I see only info e.g. 1with 2).
So how to display this data on one page if its impossible how to torn on pagination.So I canu2019t do this, I canu2019t display all data on one page (until Iu2019m using JSF tags)?
In JSF tags Iu2019m setting only path to file. In my bean Iu2019m using u201CReportClientDocumentu201D object itu2019s easy way to load report file (u201Copenu201D method) and set parameters (u201CgetDataDefController().getParameterFieldController()u201D method) and also connect to data base (u201Clogonu201D method) but I havenu2019t this property u201CsetSeparatePages(boolean)u201D.
Maybe Iu2019m doing this wrong and there is a simpler way maybe I can use somehow u201CCrystalReportVieweru201D please give my any advice. -
How I can display the values in one row when they come from the same colum
This query
SELECT
sorints_ints_code
FROM
saturn.sorints a,
connman.cc_adm_prospect_master
WHERE
sorints_ints_code like 'Z%'
and sorints_pidm = prospect_pidm
give me the results of
ZA
ZB
ZC
I want to use this query in a cursor to update a column in another table, the problem is that I need to update the table concatenating the values ZA,ZB,ZC
I have 24 different codes stored in the column sorints_ints_code, so I don’t want to use 24 different cursors and I don’t to use cross reference, It is there any way that I DON’T know to display the data like this za,zb,zc without using cross reference, I don’t want to use the table 24 times…
Like THIS, this is only for two values…
SELECT
a.sorints_ints_code,
b. sorints_ints_code
FROM
saturn.sorints a,
saturn.sorints b
connman.cc_adm_prospect_master
WHERE
a.sorints_ints_code = ‘ZA’
AND a.sorints_ints_code = ‘ZB’
and a.sorints_pidm = prospect_pidm
and b.sorints_pidm = prospect_pidm
REMEMBER, I have 24 different values
I am trying to write a procedure like this;
Someone suggest this v_int_code1 := v_int_code1||interest_coach_rec.sorints_ints_code;
BUT IT IS NOT WORKING!!!
PROCEDURE prospect_coach_interest_upd
p_prospect_term_code IN srbrecr.srbrecr_term_code%TYPE,
p_prospect_admin_err_code OUT VARCHAR2,
p_ora_err_code OUT NUMBER,
p_ora_err_msg OUT VARCHAR2
) IS
v_out_path VARCHAR2(40) := '/home/connman/student';
v_out_file VARCHAR2(40) := 'cc_adm_prospect_'||p_prospect_term_code||'_'||TO_CHAR(SYSDATE,'YYYYMMDDHH');
v_file_handle UTL_FILE.FILE_TYPE;
v_pidm NUMBER;
v_int_code1 varchar2(30);
v_int_code2 varchar2(2);
v_int_code3 varchar2(2);
CURSOR cur_pidms IS
SELECT prospect_pidm
FROM connman.cc_adm_prospect_master
WHERE prospect_term_code = p_prospect_term_code
FOR UPDATE;
CURSOR interest_coach_cur is
SELECT
sorints_ints_code
FROM
saturn.sorints
WHERE
sorints_ints_code like 'Z%'
and sorints_pidm = v_pidm ;
interest_coach_rec interest_coach_cur%ROWTYPE;
BEGIN
UTL_FILE.FCLOSE_ALL;
v_file_handle := UTL_FILE.FOPEN (v_out_path, v_out_file, 'a');
UTL_FILE.PUT_LINE (v_file_handle,
CHR (10) || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH:MI:SS')
UTL_FILE.PUT_LINE (v_file_handle, 'Entering the Admin Name procedure.');
--- BEGIN
FOR rec_pidms IN cur_pidms
LOOP
EXIT WHEN cur_pidms%NOTFOUND;
v_pidm := rec_pidms.PROSPECT_pidm;
v_int_code1 := v_int_code1||interest_coach_rec.sorints_ints_code;
IF interest_coach_cur%ISOPEN
THEN
CLOSE interest_coach_cur;
END IF;
OPEN interest_coach_cur;
FETCH interest_coach_cur
INTO interest_coach_rec;
IF interest_coach_cur%FOUND
THEN
UPDATE
connman.cc_adm_prospect_master
SET
PROSPECT_COACH_INTEREST = interest_coach_rec.sorints_ints_code
WHERE CURRENT OF cur_pidms;
END IF;
END LOOP;
COMMIT;
p_prospect_admin_err_code := '0';
UTL_FILE.put_line (v_file_handle, 'Successful Completion.');
EXCEPTION
WHEN OTHERS
THEN
p_prospect_admin_err_code := '1';
p_ora_err_msg := SUBSTR (SQLERRM, 1, 2000);
p_ora_err_code := SQLCODE;
END; -- prospect_coach_interest_upd;Search in the forum or web you will find many solutions
Return multi-row result as one comma-delimited row
http://www.oracle-developer.net/display.php?id=412 -
Write to spreadsheet file.vi is storing data in one row only.
The 8 points of data is going into one column in the spreadsheet. In the "Write to spreadsheet file string.vi" how do I write the 8 points to one row for each cycle?
I got this VI from NI's web a couple of years ago and forgot how to modify this part. I usume it is within the write file.vi.
Thank you in advance
SkipI just reread your original post and the way the "Write to Spreadsheet File.vi" that ships with LV works by default is to put 1D arrays into rows. I read your post backwards and told you how to put the data in a column. Sorry.
In any case, perhaps you need to make sure the Transpose input ISN'T true, and that the delimiter IS a tab.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Need a report column to hold data for one row only
Hey Guys,
I have a report which has a column that links to another page in my APEX application.
There is a requirement where only one of the rows in this report needs to have a link so I need the column to show the page link for one row and one row only.
The report will have about 5 rows at a time so is there a way to just make this link appear for the one row(it will be the top row) in the column attirbute in APEX? or can this be done in the SQL for the report?
Any help is much appreciated
Thanks
-MarkHi
The only way (I believe) to do this is within the SQL. Then you just wrap the column in a CASE statement and if it meets your criteria then build up the link and if not then display normally.
Something like this...
SELECT ename,
CASE WHEN empno = 7839
THEN '<a href="f?p='||:APP_ID||':4:'||:APP_SESSION||'::NO::P4_TARGET_ITEM:'||empno||'" >'||empno||'</a>'
ELSE TO_CHAR(empno)
END empno
FROM empCheers
Ben -
Combining data on one row of a report
Post Author: sdgroves
CA Forum: General
I am trying to pull data from a Student Management System. I specifically need the data from the SMS to show up like this:
Student Name Student ID English Class History Class Math Class
Jones, Rick 123456 Johnson Landers Jones
Right now I can get it to pull all of the data above but it brings it back on seperate rows:
Student Name Student ID English Class History Class Math Class
Jones, Rick 123456 Johnson
Jones, Rick 123456 Landers
Jones, Rick 123456 Jones
Any idea on how to get it to report back all on one row?
Thanks!Post Author: sdgroves
CA Forum: General
All of the data for the classes is coming from the same field on my report. That may be the problem. I may need to add a class period or something so it differentiates between classes?
Thanks for your help. -
Depicting multiple rows' data in one row
Hi All,
Pls. check the below query:
select manager_id mg_id, employee_id emp_id, last_name name from employees
where manager_id = '100'
and DEPARTMENT_ID = '80'if i run the following query, then o/p comes row wise; like below:
mg_id emp_id name
100 145 Russell
100 146 Partners
100 147 Errazuriz
100 148 Cambrault
100 149 Zlotkeybut if i want the o/p like below; i.e; under manager # 100, all employees' emp_id and name should come in only ONE row NOT in multiple rows:
mg_id emp_id name emp_id name emp_id name emp_id name emp_id name
100 145 Russell 146 Partners 147 Errazuriz 148 Cambrault 149 Zlotkeypls. help me to sort out the above sought o/p.
kindly tell me if there is any posting guidelines (except "Plain Text Help" on the right side) in this forum. i tried a lot to post above two o/p in easily readable format, but couldn't do that.
Edited by: Shariful on Sep 20, 2009 4:28 AM
Edited by: Shariful on Sep 20, 2009 4:29 AMHi,
Shariful wrote:
Hi All,
Pls. check the below query:
select manager_id mg_id, employee_id emp_id, last_name name from employees
where manager_id = '100'
and DEPARTMENT_ID = '80'
if i run the following query, then o/p comes row wise; like below:
mg_id emp_id name
100 145 Russell
100 146 Partners
100 147 Errazuriz
100 148 Cambrault
100 149 Zlotkey
but if i want the o/p like below; i.e; under manager # 100, all employees' emp_id and name should come in only ONE row NOT in multiple rows:
mg_id emp_id name emp_id name emp_id name emp_id name emp_id name
100 145 Russell 146 Partners 147 Errazuriz 148 Cambrault 149 ZlotkeyIf you want all the emp_ids and names concatenated into one big VARCHAR2 column, that's called String Aggregation
[AskTom.oracle.com|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402] shows several different ways to do it.
You can format that one big column so that it looks like separate columns.
If you want each emp_id and name in its own column, that's called Pivoting .
Look up "pivot" for various techniques. If you do not know exactly how many rows were in the original query (and therefore how many columns you'll need in the output), then it will require Dynamic SQL , which can be complicated.
Unfortunately, when you do search for "pivot", mlost of the hits will be things like "Search for pivot and you'll get lots of examples".
Re: Help for a query to add columns is one that actually has some information. It was a question very much like yours.
kindly tell me if there is any posting guidelines (except "Plain Text Help" on the right side) in this forum. i tried a lot to post above two o/p and query in easily readable format, but couldn't do that.Type these 6 characters:
(small letters only, inside curly brackets) before and after formatted text, to preserve spacing. -
Concatenate all data in one row to all data in the next row
I have been trying to do this, I'm sure simple procedure, with no luck
Table
A B
1 5
2 4
3 3
4 2
5 1
and put all the data from each row into a single cell to look like this
Table
C
1:5, 2:4, 3:3, 4:2, 5:1
I imagine I need to use some kind of recursive formula but not sure how to do that in Numbershoshi,
in C, fill with: =A&":"&B
Very simple.
By the way, nothing recursive will work in Numbers. An error message will be generated if the result of a particular cell depends in any way upon its own content.
Jerry -
Displaying data in one row for for 2 tables without relaiton
I Have 2 tables without any relation and there is a common field and i want to display data like below
table refdet
1)
refdt----------refbr----refamt----refcat
10-aug-09---10-----34234-----101a
10-aug-009--11----23245-----102a
1-AUG-09----10----455.98----104A
19-aug-09-12-----10000-------103B
2) brdet
trdt---------brn-----brtot-----------brcat
11-aug09--10-----454000-------A
09-aug-09-12-----550000-------B
30-sep-09--10-----430000------A
09-aug-09-11-----550000-------B
i want to display data for each branch refdet.refbr = brdet.brn
refdet
Br10
refdt----------refbr----refamt----refcat-----trdt---------brn-----brtot-----------brcat
10-aug-09---10-----34234-----101a-------11-aug09--10-----454000-------A
1-AUG-09----10----455.98----104A------30-sep-09--10-----430000------A
Br 11
10-aug-009--11----23245-----102a -------09-aug-09-11-----550000-------B
Br12
19-aug-09-12-----10000-------103B------09-aug-09----12-----550000-------B
i tried the following query but its not working
select distinct null as refdt,null as refbr,null as refamt,null as refcat,b.trdt,b.brn,b.brtot,b.brcat
from brdet a,refdet b
where a.refbr (+) = b.brn
union all
select distinct a.refdt,a.refbr,a.refamt,a.refcat,null as trdt,null as brn,null as brtot,null as brcat
from brdet a,refdet b
where a.refbr = b.brn (+)
its not giving the records on each row for both side its creating separte rows for each records in both table.
rgds
jytohi
-Hi jytohi,
Please lean back for a moment and study your question. Ask yourself, is this a reasonable way to ask a question?
Jopefully you'll reach the answer, "No it isn't, I need to.."
1. Turn these
1)
refdt----------refbr----refamt----refcat
2) brdet
trdt---------brn-----brtot-----------brcatinto CREATE TABLE statements.
2. Turn these
10-aug-09---10-----34234-----101a
10-aug-009--11----23245-----102a
1-AUG-09----10----455.98----104A
19-aug-09-12-----10000-------103B
11-aug09--10-----454000-------A
09-aug-09-12-----550000-------B
30-sep-09--10-----430000------A
09-aug-09-11-----550000-------Binto INSERT INTO statements
3. Turn this
refdet
Br10
refdt----------refbr----refamt----refcat-----trdt---------brn-----brtot-----------brcat
10-aug-09---10-----34234-----101a-------11-aug09--10-----454000-------A
1-AUG-09----10----455.98----104A------30-sep-09--10-----430000------A
Br 11
10-aug-009--11----23245-----102a -------09-aug-09-11-----550000-------B
Br12
19-aug-09-12-----10000-------103B------09-aug-09----12-----550000-------Binto properly formatted expected output, along with a reasonable explanation of why
4. Turn this
select distinct null as refdt,null as refbr,null as refamt,null as refcat,b.trdt,b.brn,b.brtot,b.brcat
from brdet a,refdet b
where a.refbr (+) = b.brn
union all
select distinct a.refdt,a.refbr,a.refamt,a.refcat,null as trdt,null as brn,null as brtot,null as brcat
from brdet a,refdet b
where a.refbr = b.brn (+)into a properly formatted query
And last, put everything in into curly brackets {noformat}{noformat} to preserve formatting and blank space.
Best regards
Peter -
Hi, guys I have a table filled in this way and I can't modify the data inside:
F1 F2 F3 F4
1 A null null
1 null B null
1 null null C
2 D null null
2 null E null
2 null null F
3 G null null
3 null H null
3 null null I
Is there a way to see the data in this other way (without any NULL)?:
F1F2F3F4
1 A B C
2 D E F
3 G H I
Thank you
Alex
Message was edited by:
user566533
Message was edited by:
user566533> About the Model clause, I am sure Rob can do better and I am waiting for his solution ;-)
This looks way too complex for the type of question for me. And as said you are generating more rows than necessary that have to be filtered by a subquery in the final step.
Although I'm convinced that the original poster does not have rows with data in more than one of the columns, I could not resist the challenge and came up with this:
SQL> create table mytable
2 as
3 select 1 f1, 'A' f2, null f3, null f4 from dual union all
4 select 1, 'B', null, null from dual union all
5 select 1, null, 'C', null from dual union all
6 select 1, null, 'D', null from dual union all
7 select 1, null, 'E', null from dual union all
8 select 1, null, null, 'F' from dual union all
9 select 2, 'G', null, null from dual union all
10 select 2, 'I', null, null from dual union all
11 select 2, 'H', null, null from dual union all
12 select 2, null, 'T', null from dual union all
13 select 2, null, 'K', null from dual union all
14 select 2, 'U', null, 'J' from dual
15 /
Tabel is aangemaakt.
SQL> select f1
2 , max(decode(l,2,f)) f2
3 , max(decode(l,3,f)) f3
4 , max(decode(l,4,f)) f4
5 from ( select t.*
6 , row_number() over (partition by f1, l order by f) rn
7 from ( select f1
8 , l
9 , decode(l,2,f2,3,f3,4,f4) f
10 from mytable
11 , (select 2 l from dual union all select 3 from dual union all select 4 from dual)
12 ) t
13 where f is not null
14 )
15 group by f1
16 , rn
17 order by f1
18 , rn
19 /
F1 F2 F3 F4
1 A C F
1 B D
1 E
2 G K J
2 H T
2 I
2 U
7 rijen zijn geselecteerd.which I think looks easier.
> Is there a way to delete rows in model other than using subquery?
Not really. You can leverage the "RETURN UPDATED ROWS" clause to not return the original rows, in other words: delete the original rows from the result set. But generating extra cells that are to be deleted later on, generally does not make much sense and (therefore?) there is no way to delete rows in the model clause. So the subquery is the way to do it if you really want to.
Note that I use the subquery technique too for string aggregation using the model clause, because I tested the subquery filter is more performant than the RETURN UPDATED ROWS clause.
Regards,
Rob.
Maybe you are looking for
-
Error with passwords via Portal and LDAP
When we change a user's password via portal, either by the user or administrator, the password gets changed, but then when the user tries to log in again, it says the password is expired, and no longer allows changing the password. The log has the fo
-
I have many old pictures that I would like to put on my computer to make a CD/DVD of. How can I do this? Also, how do I put old VHS tapes onto my computer or just onto a DVD? And how much would those things cost?
-
I, am now getting annoyed with i-cloud. I, have spent considerable time trying to connect my i-pod touch wirelessly with no success untill I saw on the i-tunes store tab that my i-tunes match was not turned on. I clicked to turn it on and I was asked
-
How do I view a cube from inside?
Hi, I made a textured box primative and also a textured indexed quad array cube and I want to be able to view them from the inside. Whenever I program the view to close to the inside I just see black. I thought this might have something to do with th
-
Form error Invalid numeric value 06-Jun-13 for column FECHA_CAPTURA
hi, i have an APEX form that updates a table. The form items were created autmatically from the table fields. The 3rd field is a date field and therefore the corresponding date field on the form has a calender icon on its right side. i choose a date