Limiting results in a query

S

Sung

Can anyone tell me how i can limit the results from a query to the last 5
records per field. for example, i have a comments table that has comments
field and a link field for the record it links too. how would i run a query
so that only the last 5 comments appear per link field?

thanks
 
K

KARL DEWEY

You can add TOP 5 to the SQL statement but there must be a field that is
sorted DESC so as to know what comes first or last. If the comments table
have an autonumber field or DateTime field then you are in like Flint.

SELECT TOP 5 YourTable.YourFirstField, YourTable.YourNextField, etc...;
 
Top