How can I select to show only the first 4 records

Asked

Viewed 41 times

0

Well, since my doubt doesn’t quite fit the question, I’ll continue the question here.

I intend to make a select, which shows me only the first 4 records of the database.

And then I want to do another different select, which shows me from the 5th register to the 9th database record.

How could I do that?

Thank you.

  • You want to make a record pagination?

  • That’s right! I intended to do something similar.

  • Which bank???

1 answer

1

Use the command LIMIT to define the amount of records.

Query with the first 4 records (displaying the next 4 records from Intel Zero):

SELECT * FROM tabela LIMIT 0, 4

Query the 5th record to the 9th record (displaying the next 4 records from the 5th record in order to show up to the 9th record ):

SELECT * FROM tabela LIMIT 5, 4

Browser other questions tagged

You are not signed in. Login or sign up in order to post.