convert row to column in plsql

  • hi friends

    i ve created on table create table rab(deptno number(33),

    job varchar(22));

    insert into rab ('22','clerk');

    insert into rab ('25','manager');

    insert into rab ('20','sales');

    output:

    deptno job

    22 clerk

    25 manager

    20 sales

    expexting ouput:

    deptno: 22 25 20

    job: clerk manager sales

  • raghuldrag (8/16/2012)


    hi friends

    i ve created on table create table rab(deptno number(33),

    job varchar(22));

    insert into rab ('22','clerk');

    insert into rab ('25','manager');

    insert into rab ('20','sales');

    output:

    deptno job

    22 clerk

    25 manager

    20 sales

    expexting ouput:

    deptno: 22 25 20

    job: clerk manager sales

    Question?

    This is not an Oracle forum.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • its k tell in server 2000 style

  • the output would be the same using sql or plsql

  • erics44 (8/16/2012)


    the output would be the same using sql or plsql

    If you've been able to derive the question, why not go ahead and answer?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • erics44 (8/16/2012)


    the output would be the same using sql or plsql

    Output would be the same yes you are correct.

    The syntax to get the output will not be the same.

    PLSQL <> TSQL

  • raghuldrag (8/16/2012)


    its k tell in server 2000 style

    What you want in T-SQL is a cross tab or pivot query.

    Two good articles for T-SQL Cross-Tabs and pivot queries in my signature.

    If you want the syntax in PLSQL, I suggest asking that on a dedicated Oracle forum.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply