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 |
|
awhacked
Starting Member
2 Posts |
Posted - 2010-04-19 : 22:29:46
|
| Hi all, I have a table like bellow: Table1Code Field11 aaa2 bbb3 ccc1 ddd1 eee2 fff1 gggWhat i want is to get the code and the count of each code and the result should be like this: Code Count(code)1 42 23 1Is it possible? Thanks in advance. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-04-19 : 22:40:24
|
[code]select Code, count(code)from Table1group by Code[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
awhacked
Starting Member
2 Posts |
Posted - 2010-04-19 : 22:53:59
|
| that's what i want.. it's easy but i missed the group.. thanks very much KH :) |
 |
|
|
|
|
|