|
|
| |

How can I get only the specified number of rows from my query?
Answer:
You can use the SET ROWCOUNT statement or the TOP clause of the select statement
(there is no TOP clause in SQL Server 6.5).
There are examples to return only the 10 top rows from the authors table
in the pubs database:
SET ROWCOUNT 10
GO
SELECT * FROM pubs.dbo.authors
GO
|
or
SELECT TOP 10 * FROM pubs.dbo.authors
Read about the SET ROWCOUNT statement in SQL Server Books Online.
|
|
|