Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Pivot in Oracle SQL

Pivot in Oracle SQL

From: David Zetterlund <tu.stddz_at_memo.volvo.se>
Date: Tue, 26 May 1998 13:49:12 +0200
Message-ID: <356AAC38.24A1C3E@memo.volvo.se>


Hello!

In MS SQLServer I can use the keywords TRANSFORM and PIVOT. How do I get the corresponding functionality in Oracle SQL ?

Ex.

TABLE Winecellar:

Wine			Type
"""""""""""""""		""""""""
Snake Wine		Half dry
Franco Blanc		Dry
Sweet Snake		Sweet
Belle Madame		Dry
California Sun		Dry


VIEW Type:

TRANSFORM Sum(1) AS iValue
SELECT Winecellar.Wine
FROM Winecellar
GROUP BY Winecellar.Wine
PIVOT Winecellar.[Type];

displays:

Wine		Dry		Half dry	Sweet
""""""""""""""	""""""""""""""	""""""""""""""	""""""""""""""
Belle Madame	1
California Sun	1
Franco Blanc	1
Snake Wine			1
Sweet Snake					1


If the number of winetypes is constant then there's no problem, but if they aren't...

In need of help!

David Received on Tue May 26 1998 - 06:49:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US