MySQL查詢最大值的方法並不十分復雜,下面就為您介紹MySQL查詢最大值的方法,如果您遇到過MySQL查詢最大值字段的問題,不妨一看。
- select a.*, b.count from (
- select * from message
- where to_uid=2026 and is_del<2 and from_uid>0
- order by mid desc
- )
- as a
- join
- (
- select reply_id,count(*) as count from message
- where reply_id>0
- group by reply_id
- )
- as b
- on (a.reply_id=b.reply_id)
- group by a.reply_id
- order by a.mid desc
MySQL查詢結果按某值排序
使用函數實現MySQL查詢行號
MySQL查詢中的非空問題
MySQL查詢超時問題的解決
MySQL日期函數和時間函數