Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Current mentors w/o active agreements
SELECT c.id, c.email, c.first_name, c.last_name
FROM contacts c
WHERE c.contact_type = 'Current mentor'
AND NOT c.id IN (
SELECT DISTINCT mentor_id
FROM agreements a
WHERE last_session is null
)
;
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.