469,887 Members | 1,753 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,887 developers. It's quick & easy.

How to Limit the number of rows returned with MSSQL, like the MySQL Limit clause.

1
hi

I use to work with mysql but now I need mssql. Can somebody tell my how I canwork around LIMIT to select a number of records so I can display 10 records at a time in stead of all?

Thanks
Jul 17 '07 #1
2 3150
mwasif
802 Expert 512MB
I think there is nothing exactly the same as LIMIT. But you can use TOP to get limited records. e.g. TOP 10 will return 10 records but this can not be used like TOP 20,10.

Moreover, you can loop the results to reach to your required result number and start displaying them. But this is not a good approach

I don't know the current implementation of TOP. I read this somewhere.
Jul 17 '07 #2
Atli
5,058 Expert 4TB
I've edited the title of the thread, and moved it to the Sql Server / MSSQL Forums.

Moderator
Jul 19 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Xizor | last post: by
1 post views Thread by Steve | last post: by
5 posts views Thread by Jeremy | last post: by
2 posts views Thread by Urban | last post: by
2 posts views Thread by Mike | last post: by
1 post views Thread by C. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.