各IDで挿入された最後の行を時間順で選択したい DESC
s.no id message status time
1 3 this is msg 1 unread 100001
2 2 this is msg 2 read 100002
3 4 this is msg 3 read 100003
4 3 this is msg 4 unread 100004
5 2 this is msg 5 read 100005
6 3 this is msg 6 unread 100006
私は使っている
select * from table group by id order by MAX(time) DESC
それは正しいid
シーケンスを与えていますが、行は交換され
ています。
s.no id message status time
6 3 this is msg 6 unread 100006
5 2 this is msg 5 read 100005
3 4 this is msg 3 read 100003
助けてください