1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to display the row value into column value?

Discussion in 'SQL PL/SQL' started by Panneerselvam, Dec 27, 2013.

  1. Panneerselvam

    Panneerselvam Active Member

    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    55
    Hi Friends,

    For Example:-

    Bill_no Tax_amount ----> Parent Table
    101 1000
    ---> Child Records Like
    VAT 500
    ED 300
    CESS 200
    SHEC 100
    Total 1000

    I want the output like : Bill No Tax Amount VAT ED CESS SHEC etc... It Will change Dynamically
    101 1000 500 300 200 100

    Help me..
     
  2. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation
  3. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi Panneerselvam,

    Try this, it may help you...


    select
    deptno,
    rtrim (xmlagg (xmlelement (e, ename || ',')).extract ('//text()'), ',') enames
    from
    emp
    group by
    deptno
    ;

    Here use bill_no instead of deptno.
     
    Mandeepk_g and Panneerselvam like this.