In my job I am being forced to use Microsoft SQL Server 6.5 as a database backend and I can't seem to find in it's select commands the functionality of MySQL's LIMIT. Limit in MySQL alows me to tell the database to return only x number of results starting at result number y. This is the perfect solution for spreading results over many pages through a result index and just about every search enging on the web does this and I have implemented it several times through MySQL. Now I am forced to use MS SQL server and the T-SQL SELECT doesn't have LIMIT! Help!
Hi!
Hope this helps. To get the first 20 rows only use:
select TOP 20 * from table
You cannot define a start row unfortunately, so you will have to scroll thru to the start row yourself.
regards, John
cool. how do you accomplish this in mysql?
select * from table limit 20