Normal Table
id Name Marks ddd
1 aaa 20 1
2 bbb 35 2
3 ccc 12 3
4 ddd 32 4
5 test 35 5
pivot Table
aaa bbb ccc ddd test
20 NULL NULL NULL NULL
NULL 35 NULL NULL NULL
NULL NULL 12 NULL NULL
NULL NULL NULL 32 NULL
NULL NULL NULL NULL 35
select * from dbo.[auto]
select aaa,bbb,ccc,ddd,test from dbo.[auto]
pivot(max(marks) for name in(aaa,bbb,ccc,ddd,test))as p
id Name Marks ddd
1 aaa 20 1
2 bbb 35 2
3 ccc 12 3
4 ddd 32 4
5 test 35 5
pivot Table
aaa bbb ccc ddd test
20 NULL NULL NULL NULL
NULL 35 NULL NULL NULL
NULL NULL 12 NULL NULL
NULL NULL NULL 32 NULL
NULL NULL NULL NULL 35
select * from dbo.[auto]
select aaa,bbb,ccc,ddd,test from dbo.[auto]
pivot(max(marks) for name in(aaa,bbb,ccc,ddd,test))as p
pivoting value strings of cell in pivot grid table
ReplyDeleteI am not understading your question can u explain brifly
ReplyDelete