mysql下查詢用戶,mysql如何查詢最大日期?
select * from hodelog where h_time in (select max(h_time) from hodelog group by h_hid) and h_hid=9999999 h_hid 就是需要分組的字段 也可以: mysql 分組排序取時間最大的一條記錄 SELECT A.* FROM digital_asset A, (SELECT name, max(last_updated) max_day FROM digital_asset GROUP BY name) B WHERE A.name = B.name AND A.last_updated = B.max_day