Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
SQL Server 119
#SQLServer 88
Oracle 70
#SQL SERVER 35
BRH 31
SQL Server 2012 29
denali 23
#TSQL 19
TSQL 19
C# 15

Archive · View All
October 2011 31
November 2011 30
September 2011 30
August 2011 18
December 2011 15
July 2011 13
June 2011 8
May 2012 4
April 2012 3
January 2010 3

Day 25: UnPivot Function in Oracle 11g

Oct 8 2011 4:54AM by Niladri Biswas   

Let Us Learn Oracle - Part 25 of N [ UnPivot Function of Oracle 11g ]

Purpose: Use for transposing columns into rows

It is exactly the same as Sql Server 2005 UnPivot.

Example

SQL >	Select
		ItemNo
		,ItemName
		,Amount
		From tblUnPivotExample
		UnPivot
		(
			Amount 
			For ItemName IN (Item1,Item2,Item3,Item4)
		)x;

ItemNo	ItemName	Amount
------	--------	-------
101	Item1		10
101	Item2		90
101	Item3		60
101	Item4		40
202	Item1		25
202	Item2		25
202	Item3		30
202	Item4		20

The default behaviour of UnPivot is to exclude the null rows. But we can handle so by using the INCLUDE NULLS

SQL >	Select
		ItemNo
		,ItemName
		,Amount
		From tblUnPivotExample
		UnPivot INCLUDE NULLS
		(
			Amount 
			For ItemName IN (Item1,Item2,Item3,Item4)
		)x;

Hope this is useful. Thanks for reading

Tags: #SQLServer, SQL Server, Oracle,


Niladri Biswas
7 · 21% · 6710
1
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"Day 25: UnPivot Function in Oracle 11g " rated 5 out of 5 by 1 readers
Day 25: UnPivot Function in Oracle 11g , 5.0 out of 5 based on 1 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]