1

I am having a hard time understanding the limit and offset parts of MYSQL. Could someone use this example "Get the 101st to 200th actor from the actors table. (No need to use any ordering)." and explain to me how this would work and the math behind it? Thanks!

2 Answers 2

2
`SELECT * FROM table limit 100, 100` -- get 100 records from row 101 (101 - 200)

This will give you 50 records after 101:

`SELECT * FROM table limit 100, 50` -- get 50 records from row 101 (101 - 150)

For more details, you can see the syntax and usage for limit here.

Sign up to request clarification or add additional context in comments.

1 Comment

Limit A (default = 0), B (default = #rows in the result set) - means get B rows starting at row number A + 1
0
 select actor
 from actorTable limit 100, 200

it will get all the actor starting from 101 up to 200 it will always add 1 to the min limit up to the max limit which is 200

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.