Grouping Styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Good: Grouping by column number | |
... | |
select | |
email, | |
min(expressed_interest_at) as expressed_interest_at | |
from unioned | |
group by 1 | |
order by 2 | |
... | |
# Good: Grouping by column name | |
... | |
SELECT a.email, min(b.created_at) AS expressed_interest_at | |
FROM hubspot.contact AS a | |
JOIN helpscout.conversation AS b ON a.email = b.email | |
GROUP BY a.email | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment