Results 1 to 1 of 1
  1. #1
    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 Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •