|
Hi , I have one problem, displaying data in columns. I have EX: emptable
empid Sal
1 10
2 20
3 30
4 40
5 50
.
.
.
.
100
.
.
Etc
i want this change in multiple differnt columms, in select query or in store procedure any way Ex: Empid as header and sal as columun 1 2 3 4 5 ..... 100 etc 10 20 30 40 50 .......... etc. Please help in how slove this problem Thanks Raja
(comments are locked)
|
|
You need a Cross-tab or Pivot For example see: http://weblogs.sqlteam.com/jeffs/archive/2005/05/02/4842.aspx
(comments are locked)
|
|
If it is SQL Server 2005, try http://sqlblogcasts.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx
(comments are locked)
|

