Using TOP in SQL
Posted on 2002-07-25
I have the following data in a table (example)
What I require is a SQL statement that will give me only the TOP 2 items in each group of Field2 as below (and Field1 Order DESC)
SELECT TOP 2 Field1, Field2 FROM Table Order By Field2 DESC
but this gives me
and I've tried
SELECT TOP 2 Field2, Field1 FROM Table Order by Field2 DESC
both of which are not what I'm after.
How can I achieve what I want (in code)?