Mysql將數據分組後取出時間最近的數據

select * from AccountMark as b where not exists(select 1 from AccountMark where AccountId= b.AccountId and b.CreateTime<CreateTime )mysql 謝謝這位大神的解答,這樣查出來的數據是正確的並且避免了查詢子句的問題。可是若是我要在這裏面統計出每個AccountId有多少
相關文章
相關標籤/搜索