Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group by series sometimes selects the wrong row #430

Closed
stephenharris opened this issue Jan 29, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@stephenharris
Copy link
Owner

commented Jan 29, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.