Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Group by series sometimes selects the wrong row #430
When grouping records, the record chosen can sometimes between arbitrary. See for instance https://wp-event-organiser.com/forums/topic/wrong-date-for-next-event-showing-in-archive-group-by-series/ and https://stackoverflow.com/questions/12102200/get-records-with-max-value-for-each-group-of-grouped-sql-results
The solution as detailed in the second link is to JOIN the table with itself rather than using GROUP BY.