Most Recent Date Sql

franksh Posted messages 54 Status Member -  
jee pee Posted messages 31884 Registration date   Status Moderator Last intervention   -
Hello,

I'm trying to get the most recent date from my table with no success, here is my query

 SELECT *, MAX(date_message) FROM conversations LEFT JOIN users ON users.id = conversations.id_sender WHERE id_receiver = 350 GROUP BY id_sender 


Configuration: Windows / Chrome 67.0.3396.99

1 answer

  1. jee pee Posted messages 31884 Registration date   Status Moderator Last intervention   9 979
     
    Hello,

    On a
    group by
    , you can't have all the fields, try

    SELECT id_sender, MAX(date_message)


    --
            a stranger is a friend we haven't met yet.
    0