dateTime怎么根据日期(年月日)查找数据

查询某一天的数据

select * from message  where time like '2017-11-07%';

注意:like 2017-11-07       而不是 like 2017-11-7,因为从前台传过来的数据是2017-11-7,我在这个地方浪费了一晚上。。。真是醉了


查询某个时间段的数据


mysql> select * from message  where time > '2017-11-06' and time < '2017-11-08';



猜你喜欢

转载自blog.csdn.net/qq_37171353/article/details/78533582