[dba-SQLServer] Top two of each group

Arthur Fuller artful at rogers.com
Wed May 26 06:41:59 CDT 2004


Are these strings from a single column or does your "and" represent a
group and a subgroup?

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of
Francisco H Tapia
Sent: Tuesday, May 25, 2004 3:44 PM
To: dba-sqlserver at databaseadvisors.com
Subject: [dba-SQLServer] Top two of each group


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


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list