|
harriere
Starting Member
India
3 Posts |
Posted - 06/06/2012 : 03:51:20
|
Hi i am new to sql programming..
Let me come to the point.. I am having the follwing data
290780, 'LT' 290780, 'AY' 290781, 'ILS' 290780, 'AY'
i want to output that data as follows:
290780 | 290781 as heading LT | ILS as values AY | AY |
can any one pls help me to do this...i searched a lot i didnt got it...
V.VIJAY http://harriernet.wordpress.com |
|
|
nigelrivett
Flowing Fount of Yak Knowledge
United Kingdom
3328 Posts |
Posted - 06/06/2012 : 04:29:28
|
select [290780] = t29780.col2, [290781] = t29781.col2 from (select col2 seq = row_number() over (order by col2) from tbl where col1 = 290780) t29780 full outer join (select col2 seq = row_number() over (order by col2) from tbl where col1 = 290781) t29781 on t29780.seq = t29781.seq
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy. |
 |
|