How can I make a SELECT to show only the first 4 records

0

Well, since my question does not fit completely into the question, I will continue to ask the question here.

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

And then I want to make another different select, which shows me the 5th record in the 9th record of the database.

How could I do this?

Thank you.

    
asked by anonymous 01.10.2016 / 21:52

1 answer

1

Use the LIMIT command to set the number of records.

Query with the first 4 records (displaying the next 4 records from the zero index):

SELECT * FROM tabela LIMIT 0, 4

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

SELECT * FROM tabela LIMIT 5, 4
    
02.10.2016 / 07:08