im looking for a request to load and group data
I have a 1: n parent: child relationship
and I want to pull the last child out of the parent, not the children,
means that each record must have a unique parent with the last child.
Table for children

Desired Results

I tried:
I tried the following query, but it got the oldest results
SELECT c.* FROM child AS c GROUP BY c.parent_id HAVING(MAX(c.order))
Thanks in advance
source
share