Mysql group by 实现排序 【参考】
先分组排序
SELECT
max(id) max_id
FROM xxx_table
where
deleted = 0 and enabled = 1 and time > DATE_SUB(CURDATE(),INTERVAL 1 DAY)
group by cluster_id,group_id order by max_id desc
在根据排序结果 分页查询
2021-12-03 21:18:37
先分组排序
SELECT
max(id) max_id
FROM xxx_table
where
deleted = 0 and enabled = 1 and time > DATE_SUB(CURDATE(),INTERVAL 1 DAY)
group by cluster_id,group_id order by max_id desc
在根据排序结果 分页查询