日期模糊查询 我的表里时间的类型是datetime,格式是2009-11-09 00:00:00如何进行模糊查询2009-11,只查询年月前台输入的查询条件是2009-11 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from ttt where mydatetime like '2009-11%'mysql> select curdate(),curdate() like '2009-11%';+------------+---------------------------+| curdate() | curdate() like '2009-11%' |+------------+---------------------------+| 2009-11-19 | 1 |+------------+---------------------------+1 row in set, 1 warning (0.06 sec)mysql> 或者select * from ttt where date_format(mydatetime,'%Y-%m') = '2009-11'mysql> select date_format(curdate(),'%Y-%m');+--------------------------------+| date_format(curdate(),'%Y-%m') |+--------------------------------+| 2009-11 |+--------------------------------+1 row in set (0.00 sec)mysql> mysql右表如何引用左表的值? 我把linux下的mysql文件夹拷贝了下来,想在windows下的mysql上恢复数据 (菜鸟飞飞)怎么在数据库中涉及散列 如何用perl遍历mysql表的记录,同时对列进行更新? 一个权限设置的问题 请问MYSQL!!! 规划开发一个名片系统,数据库设计方面有点疑问,特来请教! 求牛牛们给条效率高的sql语句,或者........ MYSQL安装最后一不execution后就没反应了 4张表怎么查询 什么是SQL批处理语句? 怎么写个bat 文件,直接进dos,进程连接mysql??
mysql> select curdate(),curdate() like '2009-11%';
+------------+---------------------------+
| curdate() | curdate() like '2009-11%' |
+------------+---------------------------+
| 2009-11-19 | 1 |
+------------+---------------------------+
1 row in set, 1 warning (0.06 sec)mysql>
mysql> select date_format(curdate(),'%Y-%m');
+--------------------------------+
| date_format(curdate(),'%Y-%m') |
+--------------------------------+
| 2009-11 |
+--------------------------------+
1 row in set (0.00 sec)mysql>