[dba-SQLServer] Top two of each group

Francisco H Tapia my.lists at verizon.net
Tue May 25 14:44:15 CDT 2004


I have a little select statement, which gives me a grouping of

Model1 Frame and Week1
Model1 Frame and week2
Model1 Frame and Week3
Model2 Frame and Week1
Model2 Frame and week2
Model2 Frame and Week3
Model2 Frame and Week3
Model3 Frame and week2
Model3 Frame and Week3
... etc

I'm blanking out on collecting the TOP 2 of each model, instead of 
seeing the entire model list, How would one just collect the TOP two of 
each model type?

I can think of how to do this in a cursor, but I'd like to avoid that if 
at all possible.

-- 
-Francisco





More information about the dba-SQLServer mailing list