Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
The script is read like this : SELECT * FROM `users` WHERE `gender`='Female' ORDER BY `birth_year` DESC LIMIT "take n rows" OFFSET "skip n rows" So when I wrote SELECT * FROM `users` WHERE `ge...
Answer
#1: Initial revision
The script is read like this : ``` SELECT * FROM `users` WHERE `gender`='Female' ORDER BY `birth_year` DESC LIMIT "take n rows" OFFSET "skip n rows" ``` So when I wrote ``` SELECT * FROM `users` WHERE `gender`='Female' ORDER BY `birth_year` DESC LIMIT 10 OFFSET 0 ``` It was saying to skip 0 rows and take followed 10 rows. For OFFSET=1, it was skipping only id=3 and taking other 10 rows. So the script should be like this : ``` SELECT * FROM `users` WHERE `gender`='Female' ORDER BY `birth_year` DESC LIMIT 10 OFFSET 0 ``` Then OFFSET will increase like this : 10, 20, 30, 40, 50..... Then the data will be shown correctly.