Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Perform Cross Tab on Table
Ian Waterman wrote:
> I have a three column table, col 1 Unique ID, col 2 Date Type col3
> Date.
> Each unique Id has can have upto 3 different date types. I need to
> convert data for the unique Id into a single row.
> ie
> Col 1 Unique ID, col 2 Datetyp1, col3 date1, col4 datetype2, col5
> date2, col6 datetype 3, col7 date3.
>
> Can anyone let me have or give pointers to the SQL statement to
> achieve this ? Further complication is that not all dates are
> populated so the resulting view or table must be able to accept Nulls.
>
> Thanks in advance, I am a beginner with SQL.
>
> Ian Waterman
> ian_waterman_at_hotmail.com
Use DECODE and alias the resulting columns AS the new column name.
Daniel Morgan Received on Wed May 22 2002 - 10:11:21 CDT
![]() |
![]() |