Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir, i have a table in which i have data like :--

[RNo.] [SNo.] [CID] [SID] [StuID]
[A-307] [1] [1495] [1] [1727]
[A-307] [2] [1495] [3] [1221]
[A-307] [3] [1495] [1] [1729]
[A-307] [4] [1495] [1] [1730]

i need a sql query those give me output look like :-

[SID-1] [SID-3]
[1727] [1221]
[1729]
[1730]



how can i do it..
Posted

1 solution

Use Pivot.

Below link may help you
Simple Way To Use Pivot In SQL Query[^]
 
Share this answer
 
Comments
[no name] 12-Nov-14 5:34am    
good one
:)
Shweta N Mishra 12-Nov-14 5:55am    
thank you :)
TCS54321 12-Nov-14 7:53am    
tnxx shwetaaaaa.. ;)
Shweta N Mishra 12-Nov-14 8:15am    
Please mark the answer as accepted if that worked for you.
TCS54321 13-Nov-14 4:48am    
ohk..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900