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 on date

655776Nov 19 2008 — edited Nov 19 2008
I have a table called SCHEDULE with the following fields:
date,
red,
orange,
yellow,
green

where each color represents an event for the given date. I want to do some kind of pivot table that will make each column correspond to a date, and have a single row for each color. I've read the other threads about pivot tables, but I don't know how to apply them to my situation.

See below for an example of what I want to do:

original table SCHEDULE:
date red orange yellow green
============================
19-Nov-08 John Bob John Tom
20-Nov-08 Bob Tom Tom Tom


result of pivot:
19-Nov-08 20-Nov-08
=========================
John Bob
Bob Tom
John Tom
Tom Tom
This post has been answered by Frank Kulash on Nov 19 2008
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 17 2008
Added on Nov 19 2008
2 comments
307 views