Click here to Skip to main content
15,895,283 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
hi

I have the table like this

1 aaa 1year data1
2 bbb 1year data2
3 aaa 2year data3
4 bbb 2year data4


i want to convert this to

         1year    2year
aaa      data1    data3
bbb      data2    data4


any suggestion please............!
Posted
Updated 26-Nov-13 20:52pm
v2
Comments
ChienVH 27-Nov-13 2:54am    
Try with group by statement: http://www.w3schools.com/sql/sql_groupby.asp

1 solution

Please, use SearchBox with 'pivot tag:sql' sentence[^]. There are tons of examples.
 
Share this answer
 

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