Get values for numeric conditional top

Assuming that there is a need to display, out of a number of about 30 records:

  • the first five for the first place,
  • the next 10 for the second place and
  • another 14 for the third place.

This can be easily done in MySQL by using of LIMIT and OFFSET.

In the simple version, it can be seen that the position from which the display starts is passed first, then the record limit, second. It can also be noted that the position from which the extraction actually starts is from offset+1.

They will be extracted up to position 29, but to save space, I shortened the image…

Source: w3Schools.com

Author: Ovidiu.S

I am quite passionate about this professional area as if I know something - no matter how little - I want to share it with others.

Leave a Reply