• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

SQL statement help

I'm trying to figure out how to return just rows A through B in a query. I can't use the top 10 or what have you because I don't want the top ten, but the records 11 - 20, or similar.

Been querying the web for help but can't find anything related. Surely someone has needed this before...for example the pages here on Anandtech, on page two it only wants to return records 26-50. help please
 
Entity, you failed to explain to him the LIMIT options.

SELECT * FROM tablename LIMIT 11, 20

The first number is the row offset and the second is the amount of rows you want to display. So, the above will actually return 20 rows starting from the 11th row.
 
alright guys, its not working.

SELECT * FROM tablename WHERE 1 LIMIT 11,20
NOR
SELECT * FROM tablename WHERE LIMIT 11,20
NOR
SELECT * FROM tablename LIMIT 11,20

are working

...getting error "Unable to parse query text." Using SQL 2000
 
I don't think LIMIT is standard ANSI SQL. You'll have to dig around for a proprietary T/SQL feature.

Personally, I wouldn't use LIMIT as I understand it.
 
Ah...yeah, I think manly is right - LIMIT probably isn't ANSI SQL. For some reason, I thought you said MySQL.

You probably should just look around and see what the equivalent is - I'd imagine there is an equivalent for SQL2k.

Rob
 
Originally posted by: Entity
Ah...yeah, I think manly is right - LIMIT probably isn't ANSI SQL. For some reason, I thought you said MySQL.

You probably should just look around and see what the equivalent is - I'd imagine there is an equivalent for SQL2k.

Rob
🙂 I've been looking for it
 
Back
Top