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 |
|
rity
Starting Member
4 Posts |
Posted - 2005-10-20 : 07:59:54
|
| select ID, count(*) as number_of_records from table1 group by ID having count(*) > 10 order by number_of_records descID number_of_records ------------ ----------------- 0001 164 0002 135 0003 131 0004 70 I have table (table1) width two columns. I have 164 records for value 0001 in colummn ID, 135 records for value 0002 in colummn ID, ...Now I have to get first 10 records for each ID. 10 records for ID = 0001, 10 records for ID = 0002, 10 records for ID = 0003,...Is it possible to make select statement to get these records in one Grid? |
|
|
karuna
Aged Yak Warrior
582 Posts |
Posted - 2005-10-20 : 08:07:58
|
| Check thisSelect Top 10 From Table1 where id = 0001ThanksKarunakaran |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|