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.
| Author |
Topic |
|
pamyral_279
Posting Yak Master
143 Posts |
Posted - 2010-05-05 : 02:11:02
|
| Hi all,I have structure table as :QuestionID---Answer1--------------102--------------503--------------104--------------905--------------906--------------90.....Expected outputAnswer--Count10------250------190------3........Anyone help me ?Thank you very much. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-05-05 : 02:12:14
|
[code]select Answer, count(*)from yourtablegroup by Answer[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-05 : 02:14:02
|
select Answer,count(*) as [Count]from tablegroup by Answerorder by Answer No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-05 : 02:14:43
|
This old rocker was too late again... No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
pamyral_279
Posting Yak Master
143 Posts |
Posted - 2010-05-05 : 02:18:33
|
| Thanks very much.I did it. |
 |
|
|
|
|
|