Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross Tab and Decode in SQL

Status
Not open for further replies.

starter

MIS
May 11, 2001
2
0
0
US
I'm basically a Oracle programmer and now working on DB2. I have a requirement to show rows in column. I used to use DECODE function in oracle to do that. Is there a way in DB2 to display rows in column fashion.

For Ex:

Dept Name Total Employees
----------- ---------------
Finance 22
WareHouse 70
Production 50

I want to show the above data in query as follows (just using plain SQL)

Finance WareHouse Production
22 70 50

Please help me..

Sat
 
hi

i do want the same result. plz inform me the query if you got some reply

my id is

babu_joseph75@rediffmail.com

bye bye babu joseph
 
I think you may use the instruction CASE. This is the way I do it.
bye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top