Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Name Grade1 Grade2Alen A BJony A,C B,Y,LAlen A,D,E B,FSyam A B,YSyam A D,Y
I want to know the count of grades for each name. The output i am looking is as below. Plz let me know how can i query for this.
Name Grade1Cnt Grade2CntAlen A=2,D=1,E=1 B=2,F=1Jony A=1,C=1 B=1,Y=1,L=1Syam A=2,B=1 D=1,Y=2
developer :)
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-10-12 : 22:10:44
you have multiple value (A, D, E) in the column ? And you want the result in CSV ?KH[spoiler]Time is always against us[/spoiler]
satish.gorijala
Posting Yak Master
182 Posts
Posted - 2009-10-12 : 22:21:43
No, As i said above, i want the count of grades for each name. For name "Alen" The count of grade columns is<code>Name Grade1Cnt Grade2CntAlen A=2,D=1,E=1 B=2,F=1</code>
quote:Originally posted by khtan you have multiple value (A, D, E) in the column ? And you want the result in CSV ?KH[spoiler]Time is always against us[/spoiler]
developer :)
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-10-12 : 22:32:57
this is a pretty bad design of the table. Any chances to change that ?KH[spoiler]Time is always against us[/spoiler]
satish.gorijala
Posting Yak Master
182 Posts
Posted - 2009-10-12 : 22:52:05
No... The design is ok as per the requirement.
quote:Originally posted by khtan this is a pretty bad design of the table. Any chances to change that ?KH[spoiler]Time is always against us[/spoiler]
developer :)
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-10-12 : 22:53:26
quote:Originally posted by satish.gorijala No... The design is ok as per the requirement.
quote:Originally posted by khtan this is a pretty bad design of the table. Any chances to change that ?KH[spoiler]Time is always against us[/spoiler]