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!

Pivot table result without aggregate function

user8845626Feb 19 2014 — edited Feb 24 2014

Hi all,

We have the following two tables:

SQL> select * from class;

  CLASS_ID     COURSE

---------- ----------

         1          1

         2          1

         3          1

         2          2

         3          2

         5          2

6 rows selected.

SQL> select * from course;

COURSE_ID

----------

         1

         2

The client requires the output in the following format:

course          class          class          class

1                    1               2               3

2                    2               3               5

I have considered the use of pivot tables however they require the use of an aggregate function, but there is no aggregation required in the result here - we just require the output to be displayed as would a pivot table?

This post has been answered by Partha Sarathy S on Feb 19 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2014
Added on Feb 19 2014
9 comments
7,442 views