Select the Latest Message Between the communication of two user in mysql

后端 未结 6 1887
旧时难觅i
旧时难觅i 2020-12-17 03:33

I have a simple table maintaining messages between users. The table structure looks like

     sender    receiver   message   sendtime
      1          2              


        
6条回答
  •  孤城傲影
    2020-12-17 04:09

    Try this:

    SELECT  Distinct (*)
    FROM    tableName   m
    WHERE   date =
        (
        SELECT  MAX (date)
        FROM    tableName
    
        )
    

提交回复
热议问题