Advertisement
Guest User

Untitled

a guest
Aug 14th, 2015
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. ID LASTNAME FIRSTNAME EMAIL
  2. 567 Jones Carol carolj@gmail.com
  3. 567 Jones Carol caroljones@aol.com
  4. 678 Black Ted tedblack@gmail.com
  5. 908 Roberts Cole coleroberts@gmail.com
  6. 908 Roberts Cole coler@aol.com
  7. 908 Roberts Cole colerobersc@hotmail.com
  8.  
  9. 567 Jones Carol carolj@gmail.com
  10. 567 Jones Carol caroljones@aol.com
  11. 908 Roberts Cole coleroberts@gmail.com
  12. 908 Roberts Cole coler@aol.com
  13. 908 Roberts Cole colerobersc@hotmail.com
  14.  
  15. select distinct x.id, x.lastname, x.firstname, x.email
  16. from t as x
  17. join (
  18. select id
  19. from t
  20. group by id
  21. having count(distinct email) > 1
  22. ) as y
  23. on x.id = y.Id
  24.  
  25. select x.*
  26. from member as x
  27. where x.id IN
  28.  
  29. (
  30. select id
  31. from member
  32. group by id
  33. having count(distinct email) > 1
  34. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement