mysql如何查询昨天的数据

假设localdate为时间字段

select * from user where date(localdate) = date_sub(curdate(),interval 1 day);

这样既可得到昨天的数据。

Logo

更多推荐