Need SQL Help

In this forum you can share stuff related to Oracle 11g, 10g, 9i.
Post Reply
zeenat khan
Posts: 35
Joined: Wed Apr 04, 2007 4:15 am
Location: Pakistan

Need SQL Help

Post by zeenat khan »

i have two Tables
A and B

data in tables as

Table A
-------
SNo Sname
1 a
2 b
3 c

Table B
--------
SNo Course
1 x
1 y
1 k
1 z
2 x
2 z
2 d
3 y
3 z
3 e

I need the output in the following format where course is x or y or z.

1 x y z
2 x z
3 y z
amirtai
Posts: 138
Joined: Sat Apr 08, 2006 5:54 pm
Location: Canada
Contact:

Post by amirtai »

It's a some how cross table transformation. I would use decode() function to get desired result.

Thanks
Amir
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests