首页 > 数据库技术 > 详细

mysql日期模糊查找的方法

时间:2019-11-02 12:54:53      阅读:94      评论:0      收藏:0      [点我收藏+]
Mysql模糊查询有以下三种方法:

1.Convert转成日期时间型,在用Like查询。select * from table1 where convert(date,DATETIME) like ‘2006-04-01%‘
第一种方法应该适用与任何数据类型;

2.Betweeselect * from table1 where time between ‘2018-08-01 0:00:00‘ and ‘2018-08-01 24:59:59‘";
第二种方法适用String外的类型;

3 datediff()函数select * from table1 where datediff(create_time,‘2018-08-01‘)=0
第三种方法则是为date类型定制的比较实用快捷的方法。

mysql日期模糊查找的方法

原文:https://www.cnblogs.com/superming/p/11780991.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!