php - MYSQL - FInd last date and group by IDUSER -
this question has answer here:
- get latest date grouped mysql data 7 answers
i have message system on site , see list of users sent me message while displaying last message of each user. same way facebook.
so, have table idusersender, iduserreceiver, date , message
i tried on several time take query can not have last message of each.
idea?
ok, again, try please
select message my_table iduserreceiver = 'my_id' , date in (select max(date) my_table group idusersender);
Comments
Post a Comment