Skip to content

Instantly share code, notes, and snippets.

@mattm

mattm/inner.sql Secret

Created Nov 12, 2018
Embed
What would you like to do?
Implicit vs Explicit INNER
# Good: Specifying INNER
...
select a.email
, a.created_at as expressed_interest_at
from helpscout.conversation a
INNER JOIN
helpscout.conversation_tag b
ON a.id = b.conversation_id
where b.tag = ‘beacon-interest’
...
# Good: Omitting INNER
...
SELECT HC.`email`, DATE_FORMAT(HC.`created_at`, '%Y-%m-%e %T UTC') AS expressed_interest_at
FROM `helpscout.conversation` AS HC
JOIN `helpscout.conversation_tag` AS HCT ON HC.`id`=HCT.`conversation_id` WHERE HCT.`tag`='beacon-interest'
ORDER BY expressed_interest_at
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment