Guest User

Untitled

a guest
Aug 13th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. select email
  2. from Email_Table t1
  3. where not exists (select email
  4. from Contacted_table t2
  5. where t1.email = t2.email)
  6.  
  7. select email
  8. from Email_Table t1
  9. where email not in (select email
  10. from Contacted_table)
  11.  
  12. SELECT email FROM email_table e
  13. LEFT JOIN contacted_table c ON e.email = c.email
  14. WHERE c.email IS NULL
  15.  
  16. SELECT users.email, contacted.email
  17. FROM users LEFT JOIN contacted ON users.email = contacted.email
  18.  
  19. users.email | contacted.email
  20. -----------------------------
  21. aa@aa.com | aa@aa.com
  22. bb@bb.com | bb@bb.com
  23. cc@cc.com | cc@cc.com
  24. dd@dd.com | NULL
  25. ee@ee.com | NULL
  26.  
  27. SELECT users.email
  28. FROM users LEFT JOIN contacted ON users.email = contacted.email
  29. WHERE contacted.email IS NULL
Add Comment
Please, Sign In to add comment