Is there any way to select, for example, first 10 rows of a table in T-SQL (working MSSQL)? I think I saw something in Oracle defined as rownum meta variable, used in a following way
select * from Users where rownum<=10
select top(@count) * from users
If @count is a constant, you can drop the parentheses:
@count
select top 42 * from users
(the latter works on SQL Server 2000 too, while the former requires at least 2005)
1.4m articles
1.4m replys
5 comments
57.0k users