![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Think outside the box! ************************************************* |
|
Does MS SQL support LIMIT? I'd like to implement paging at the query level. Examples of this in a book I have involve temporary tables and the like. Then I read something about LIMIT. Would LIMIT be the best way to implement paging? I'm using MS SQL Express on my development computer. It doesn't appear to support LIMIT. Does MS SQL? Thanks. -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#3
| |||
| |||
|
|
Does MS SQL support LIMIT? I'd like to implement paging at the query level. Examples of this in a book I have involve temporary tables and the like. Then I read something about LIMIT. Would LIMIT be the best way to implement paging? I'm using MS SQL Express on my development computer. It doesn't appear to support LIMIT. Does MS SQL? Thanks. |
#4
| |||
| |||
|
|
No, but you can use TOP. For example, to get the following: SELECT column FROM table LIMIT 10 You would use SELECT TOP 10 column FROM table |
|
You do not have OFFSET, however, so you have to use a WHERE clause and keep tabs of beginning and end ids to select the next page. If you also allow sorting, you will have to make your method of selecting flexible enough to store pointers on each of the fields one can sort on. |
#5
| |||
| |||
|
|
TOP will work, but if you are looking for OFFSET later then you are out of luck. This is one of those features that everyone has been begging for for years now, as long as I have used mssql, but they won't give us. Probably because of some NIH proplem, as usual, along with the customary smidgen of arrogance. So we are stuck with this bastard child "top" ![]() Does MS SQL support LIMIT? I'd like to implement paging at the query level. Examples of this in a book I have involve temporary tables and the like. Then I read something about LIMIT. Would LIMIT be the best way to implement paging? I'm using MS SQL Express on my development computer. It doesn't appear to support LIMIT. Does MS SQL? Thanks. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |