If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > How to get row values as column names.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Mar 2004
Posts: 1
How to get row values as column names.

Hi every one,

Can anybody help me with a report which has to display Row values of the table as Column. The number of columns for a row in the final recordset is not fixed. In Addition to this the Group by clause is not fix.

The table used is something like this,

Name Null? Type
----------------------------------------------------- -------- ---------------
ADC_DATA_ID NOT NULL NUMBER(15)
REPORT_RECORD_ID NOT NULL NUMBER(15)
DP_FIELD_ID NOT NULL NUMBER(8)
DP_FIELD_NAME NOT NULL VARCHAR2(30)
VALUE NOT NULL VARCHAR2(50)
SEQUENCE NUMBER(2)

The column name must be value in the DP_FIELD_NAME column
and the value for the column must be VALUE column. And the columns must be in the sequence defined by the column SEQUENCE.

Lets say if there are 10 rows in this table for a REPORT_RECORD_ID,
then 4(not fix) of the columns needs to be there in group by clause.

The number of columns for a REPORT_RECORD_ID is not fix.
For one REPORT_RECORD_ID it might be 10 and for other it might be 6.
But all of them must come together in one report.

Is it possible to get such kind of RecordSet in Oracle SQL?


Thanks in Advance,
Swati.
Attached Files
File Type: zip reportdetails.zip (39.1 KB, 116 views)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On