MySQL Forums
Forum List  »  Newbie

Re: query data from 2 tables with MAX(datetime)
Posted by: Jeffrey Feeter
Date: March 06, 2015 06:09PM

Peter,
Thank you very much! That worked great. To also display the username, I changed it to:
select a.username, a.lastname, a.firstname, max(b.datetime) as 'Last login'
from members a
join logins b using(username)
group by a.lastname, a.firstname;
Works like a charm. Thank you very much for your time.
Jeff

Options: ReplyQuote


Subject
Written By
Posted
Re: query data from 2 tables with MAX(datetime)
March 06, 2015 06:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.