Query help in SQL Server 2005
-
hai all, In my database table i have a data in a table like below X 102 Y 101 Z 123 X 142 Y 245 Z 625 X 234 Y 432 Z 111 How can i get the data from table kike below. X Y Z 102 101 123 142 245 625 234 432 111 Please help me how to write select query for below. Thanks in advance, cheers, sekhar
modified on Saturday, April 4, 2009 7:26 AM
-
hai all, In my database table i have a data in a table like below X 102 Y 101 Z 123 X 142 Y 245 Z 625 X 234 Y 432 Z 111 How can i get the data from table kike below. X Y Z 102 101 123 142 245 625 234 432 111 Please help me how to write select query for below. Thanks in advance, cheers, sekhar
modified on Saturday, April 4, 2009 7:26 AM
Hi, You need to use SQL 2005's PIVOT statement. Have a look at examples here[^]. Regards, Syed Mehroz Alam.
My Blog My Articles Computers are incredibly fast, accurate, and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination. - Albert Einstein