문제

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!

도움이 되었습니까?

해결책

`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.

다른 팁

 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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top