Skip to content

Instantly share code, notes, and snippets.

Last active Nov 12, 2018
What would you like to do?
WHERE clause vs JOIN condition
# Good: Filtering in the WHERE clause
cnv.created_at AS expressed_interest_at
FROM helpscout.conversation AS cnv
JOIN helpscout.conversation_tag AS ctg
ON = ctg.conversation_id
WHERE ctg.tag = 'beacon-interest'
# Good: Including it in the join condition
select, conv.created_at as expressed_interest_at
from helpscout.conversation conv
join helpscout.conversation_tag tag
on = tag.conversation_id and tag.tag = 'beacon-interest'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment