MySQL Forums
Forum List  »  Newbie

Re: Selecting all from one table and a MAX value from another table
Posted by: Peter Brawley
Date: July 23, 2019 07:49PM

Is this what you mean?

select s.sessionid, d.maxdatatime
from sessions s
join (
  select sessionid, max(datatime) as maxdatatime
  from sessiondata
  group by sessionid
) d using(sessionid);

Options: ReplyQuote


Subject
Written By
Posted
Re: Selecting all from one table and a MAX value from another table
July 23, 2019 07:49PM


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.