Showing posts with label 11g. Show all posts
Showing posts with label 11g. Show all posts
Saturday, November 07, 2009
Sunday, April 12, 2009
Monday, November 19, 2007
Tuesday, October 09, 2007
Installing Oracle 11g RAC on virtual servers using VMware
This post describes the installation of Oracle 11g RAC on virtual servers.
Thursday, September 20, 2007
Wednesday, September 19, 2007
Pivot in 11g
Pivoting is a key technique in data warehouses. In it, you transform multiple rows of input into fewer and generally wider rows in the data warehouse. When pivoting, an aggregation operator is applied for each item in the pivot column value list. The pivot column cannot contain an arbitrary expression. If you need to pivot on an expression, then you should alias the expression in a view before the PIVOT operation. The basic syntax is as follows:
SELECT ....
FROM
PIVOT
(
aggregate-function()
FOR IN (, ,..., )
) AS
WHERE .....
Example: Pivoting
The following statement illustrates a typical pivot on the channel column:
SELECT * FROM
(SELECT product, channel, amount_sold
FROM sales_view
) S PIVOT (SUM(amount_sold)
FOR CHANNEL IN (3 AS DIRECT_SALES, 4 AS INTERNET_SALES,
5 AS CATALOG_SALES, 9 AS TELESALES))
ORDER BY product;
PRODUCT DIRECT_SALES INTERNET_SALES CATALOG_SALES TELESALES
---------------------- ------------ -------------- ------------- ---------
...
Internal 6X CD-ROM 229512.97 26249.55
Internal 8X CD-ROM 286291.49 42809.44
Keyboard Wrist Rest 200959.84 38695.36 1522.73
Documentation here
SELECT ....
FROM
PIVOT
(
aggregate-function(
FOR
) AS
WHERE .....
Example: Pivoting
The following statement illustrates a typical pivot on the channel column:
SELECT * FROM
(SELECT product, channel, amount_sold
FROM sales_view
) S PIVOT (SUM(amount_sold)
FOR CHANNEL IN (3 AS DIRECT_SALES, 4 AS INTERNET_SALES,
5 AS CATALOG_SALES, 9 AS TELESALES))
ORDER BY product;
PRODUCT DIRECT_SALES INTERNET_SALES CATALOG_SALES TELESALES
---------------------- ------------ -------------- ------------- ---------
...
Internal 6X CD-ROM 229512.97 26249.55
Internal 8X CD-ROM 286291.49 42809.44
Keyboard Wrist Rest 200959.84 38695.36 1522.73
Documentation here
Subscribe to:
Posts (Atom)