MySQL Forums
Forum List  »  PHP

Pagination Group By - limit
Posted by: Aramis arara
Date: January 22, 2018 09:45PM

Good evening ...



I am trying to query with grop by and limit, but I can not make the query work.

I have a table with 6 fields (name, address, city, state, level, date) and this table has 200,000 rows.

I'm trying to make an appointment where names appear by state.

Ex.:

State Name address city state level

Ac Aramis test Rio Branco AC 3

Ac Paulo test Rio Branco AC 3

Ac Such tests Rio Branco AC 3

Sp Joao teste Sorocaba SP 3

Sp Marcio test São Paulo SP 3

...



I did so:

SELECT * FROM table_name WHERE level = '3' GROUP BY state ORDER BY state ASC limit $ start, $ quantity



It lists and groups by state but does not paginate.



Can someone help me ????



Thank you

Options: ReplyQuote


Subject
Written By
Posted
Pagination Group By - limit
January 22, 2018 09:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.