SELECT MAX(id) FROM `tbl`
WHERE createdat BETWEEN ADDDATE(DATE_FORMAT(NOW() ,"%Y-%m-%d"), INTERVAL -6 DAY) AND DATE_FORMAT(NOW(),'%Y-%m-%d')
GROUP BY DATE_FORMAT(createdat,'%Y-%m-%d')
)
select * from audit_session where login_time<=(CurDate()-7) and login_time>='DATE_SUB(now() , INTERVAL 1 DAY) 00:00:00'欢迎分享,转载请注明来源:内存溢出
评论列表(0条)