MySQL根据时间筛选用户最新的一条记录

select t.*
from (SELECT *
from person where create_time<'2022-08-01 00:00:00' HAVING 1
order by create_time desc)c
group by c .code;

 

posted @ 2022-07-21 15:45  迷糊桃  阅读(1131)  评论(0编辑  收藏  举报