我有一個表在MySQL:Mysql的GROUP BY和獨特的價值
SID DID MessageType DateOf Message 1 255 LOG 2010-01-17 15:02:05 Log msg 1 2 255 USER 2010-01-17 19:02:05 User msg 1 3 211 LOG 2010-01-17 15:06:55 Log msg 2 4 211 ADMIN 2010-01-17 22:06:55 Admin msg 1
我需要得到最後(通過DateOf)消息和消息類型,細分電子郵件由DID, 下令DateOf DESC
權結果將是:
DID MessageType DateOf Message 211 ADMIN 2010-01-17 22:06:55 Admin msg 1 255 USER 2010-01-17 19:02:05 User msg 1
我該如何做這個select查詢? MySQL 5.1