Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save darrellsilver/e5dfe8b46da7eb99e20a6f1b3b3f26b5 to your computer and use it in GitHub Desktop.
Save darrellsilver/e5dfe8b46da7eb99e20a6f1b3b3f26b5 to your computer and use it in GitHub Desktop.

Revisions

  1. Darrell Silver renamed this gist Apr 29, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Darrell Silver created this gist Apr 29, 2016.
    9 changes: 9 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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
    )
    ;