Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Pivot Tables

Author  Topic 

ssmani84
Starting Member

20 Posts

Posted - 2010-03-11 : 04:40:51
hi friends,
StudentID SubjectI… Marks ClassName SectionNam… StudentName SubjectName
1 1 98 1stStandard… A Naveen Tamil
1 2 98 1stStandard… A Naveen English
1 3 98 1stStandard… A Naveen Maths
1 4 98 1stStandard… A Naveen Science
1 5 98 1stStandar… A Naveen geograp
This is my result query

but i want show the front end res

Name Tamil English maths Science Geograp
naveen 98 98 98 98 98

how can i get This type of result pls help me



ssmaniyadav

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-11 : 05:06:07
check out the PIVOT operator


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

ssmani84
Starting Member

20 Posts

Posted - 2010-03-11 : 05:14:39

thanks khtan

i dont know how to use pivot operator ....Pls tell me about Pivot Operator

ssmaniyadav
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-11 : 05:22:42
have you try to check it out in the Books OnLine ?

BOL
http://msdn.microsoft.com/en-us/library/ms177410.aspx

Further Example
http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=PIVOTData


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-11 : 05:57:53
This is for Dynamic PIVOT
http://beyondrelational.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -