Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to transpose the table?

684278Jun 26 2009 — edited Jun 30 2009
Hi, guys.

Could you please help me to resolve the following problem:i have the following input table
WITH input_table
AS
  (
    select 1 A, 2 B, 3 C from dual
    union all
    select 4, 5, 6 from dual
    union all
    select 7, 8, 9 from dual
  )
SELECT *
FROM input_table;
I need to receive the following table using ONLY sql syntax (without any procedures):
WITH result_table
AS
  (
    select 7 A, 4 B, 1 C from dual
    union all
    select 8, 5, 2 from dual
    union all
    select 9, 6, 3 from dual
  )
SELECT *
FROM result_table;
Wait for your suggestons. Thanks.

Victor
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2009
Added on Jun 26 2009
8 comments
9,375 views