MySQL Forums
Forum List  »  Newbie

Re: query Selecting Last entry per computer for a group from two tables. Urgent Help please.
Posted by: milad yousif
Date: April 23, 2018 12:47AM

Oh Hi Peter,

Thanks a million for your kind help and efforts..

I was trying to teach myself more about Database and was kind of stooging around with the code for the last couple of days as I did not see your message..however could not get it to work.

I tried your code and its showing me the right timestamps for last updates per each computer perfectly but when I add the person name field the names dont match :'( I am so tired of this I can not seam to be able to achieve it


select r.id, max(e.timestamp) as latest, e.name
from mrbs_room r
join mrbs_entry e on r.id=e.room_id
where r.area_id=1 and r.disabled=0
group by r.id;

e.name does not match the real record :'(


Thank peter you are the best man

Options: ReplyQuote




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.