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 |
|
DaveyB
Starting Member
10 Posts |
Posted - 2008-06-28 : 16:41:44
|
| Dear All, I have a column like thisAlphabet_LettersABACBCDAEWhat I want to do is cound all the A's, B's and C's in there. How would I approach this task. I tried using a case statement but when I used the COUNT method it produced an error. Thanks! |
|
|
maninder
Posting Yak Master
100 Posts |
Posted - 2008-06-28 : 19:48:14
|
| select distinct name,count(*) from columnGroup by columnManinder |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-29 : 02:25:44
|
quote: Originally posted by maninder select distinct name,count(*) from columnGroup by columnManinder
why do you need distinct here? i think this is enoughselect Alphabet_Letters,count(*)from Youratbelgroup by Alphabet_Letters |
 |
|
|
maninder
Posting Yak Master
100 Posts |
Posted - 2008-06-29 : 11:34:46
|
| u r correct.Maninder |
 |
|
|
|
|
|