Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID LASTNAME FIRSTNAME EMAIL
- 567 Jones Carol carolj@gmail.com
- 567 Jones Carol caroljones@aol.com
- 678 Black Ted tedblack@gmail.com
- 908 Roberts Cole coleroberts@gmail.com
- 908 Roberts Cole coler@aol.com
- 908 Roberts Cole colerobersc@hotmail.com
- 567 Jones Carol carolj@gmail.com
- 567 Jones Carol caroljones@aol.com
- 908 Roberts Cole coleroberts@gmail.com
- 908 Roberts Cole coler@aol.com
- 908 Roberts Cole colerobersc@hotmail.com
- select distinct x.id, x.lastname, x.firstname, x.email
- from t as x
- join (
- select id
- from t
- group by id
- having count(distinct email) > 1
- ) as y
- on x.id = y.Id
- select x.*
- from member as x
- where x.id IN
- (
- select id
- from member
- group by id
- having count(distinct email) > 1
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement