for sql 7:
select top 20 <rest of select statement>
for sql 6.x
set rowcount 20
<select statement>
hth,
William
for sql 6.x
set rowcount 20
<select statement>
hth,
William
Remember to ORDER BY DESC (or ASC) if you want the top (or bottom) 20
> for sql 6.x
> set rowcount 20
> <select statement>
> hth,
> William
SELECT TOP 20 * FROM tablename
1. How can i make select that will return only 20 first results
Either set rowcount 20 or select top 20
--
Tony Rogerson MCP, SQL Server MVP
www.sql-server.co.uk [ Dedicated site to MS SQL Server -
Tutorials,
Code library,
FAQ and potential UK user group.
]
2. Fixing new area codes - can I purchase a database?
3. VFP 3.0 - Printing only selected pages (ie:9-20 instead of 1-25)
4. help
5. returning first 20 records only via ASP
6. A VERY Strange DATEDIFF problem
7. First 20 records from a select, after ordering
8. Date conversions in DTS packages
9. get only first 20 records from a select
10. Select Rows After first 20 Rows
11. How to select only the first 20 rows in a SQL statement
12. Bad side-effect from making EXPLAIN return a select result
13. Any idea on returning 20 results a time