Re:SQL queries don't start with SELECT
by TehShrike on Thursday October 03, 2019 @06:24PM
(#21152912)
I've called it the "GROUPing pitfall" since those extra JOINs only really come back to bite you when you try to aggregate the results: https://wikido.isoftdata.com/index.php?title=The_GROUPing_pi...
[ Parent
| on HN ]
Re:SQL queries don't start with SELECT
by pjungwir on Thursday October 03, 2019 @07:01PM
(#21153173)
Nice writeup! The nasty part is that you don't get an error, you just get wrong answers. You might not even notice for a while. Such bad news!
Thanks to both of you for these articles. I'm very fond of outer joins as in most cases (in my day to day work) they're exactly what I need. While I don't use them often with aggregate queries, I didn't realize that multiple OUTER JOINS will break aggregates. I'll need to review my query logs to make sure I'm not doing this anywhere.