Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select distinct email, datetime
- from Log
- where email in (select email from tmp)
- group by email;
- | email | datetime |
- +----------------------------+---------------------+
- | aaa@gmail.com | 2014-02-06 14:08:28 |
- | bbb@gmail.com | 2014-05-22 18:53:39 |
- | cc@gmail.com | 2014-05-22 18:51:19 |
- +----------------------------+---------------------+
- select email, max(datetime )
- from Log
- where email in (select email from tmp)
- group by email;
- select distinct email, max(datetime)
- from Log
- where email in (select email from tmp)
- group by email;
- select distinct email, datetime
- from Log
- where email in (select email from tmp)
- group by email
- ORDER BY datetime desc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement