您的位置:首页 > 数据库 > MySQL

关于时间的模糊查询 mysql

2009-12-29 16:35 351 查看
关于时间的模糊查询 mysql

1. select * from tableName where fieldName like '2009-12-29%';

2. select * from tableName where ( datediff ( fieldName , '2009-12-29' ) = 0 );

3. select * from orders where tableName between '2009-12-10 24:00:00' and '2009-12-29 23:00:00';
4. select * from tableName where year(fieldName)='2009' And month(fieldName)='12';

参考: (http://www.diybl.com/course/7_databases/database_other/20090426/165388.html)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: