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 |
kraja_be
Starting Member
1 Post |
Posted - 2005-04-11 : 07:19:53
|
Hi guys,i need help to form this query in sql server 2000.i have to get data from a column which is having maximum no of countif my data is like this Item____teateacoffeecoffeecoffeecoffeewaterwaterwaterthen i should getcoffee 4Thanks in advance. |
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2005-04-11 : 07:39:28
|
Select top 1 item, Cnt = count(*)From <yourTable>Group By itemOrder By Cnt DescCoreySecret Service Agent: Mr. President, you're urinating on me.President Lyndon Johnson: I know I am. It's my prerogative. |
|
|
|
|
|