Quantcast
Channel: Transpose of Result set
Viewing all articles
Browse latest Browse all 4

Transpose of Result set

$
0
0

CREATETABLE customer(nameVARCHAR(25), classVARCHAR(25) , IDINT

,ProductVARCHAR(20))

INSERTINTO customer (Cust, Product, QTY)

VALUES(‘A’,’x’,1,’L’)

INSERTINTO customer (Cust, Product, QTY)

VALUES(‘B’,’y’,2,’M’)

INSERTINTO customer (Cust, Product, QTY)

VALUES(‘C’,’z’,3,’N’)

INSERTINTO customer (Cust, Product, QTY)

VALUES(‘D’,’u’,4,’O’)

 

Select * fromcustomer

 

Name, Class, ID, Product

A      x     1    L

B      y     2    m

C      z     3    n

d      u     4    O

 

Above is the result set but in my SSRS report i want to display result like following. its thetranspose of result set, how i can achieve following result by ssrs or by SQL query.

 

I need is like following

 

product    L     M     N     O

Name       A     B     C     D

Class      X     Y     Z     U

ID         1     2     3     4


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images