请教mysql to_days() 的用法,谢谢, 比如我想查询2008年7月25日那天的记录,我应该怎么调用 to_days() ?select * from 表名 where 后面的调用 to_days() 试了几种日期的方式都报错,请指点,谢谢. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from 表名 where rq>='2008-7-25' wwwwb, mysql 里面不认 rq 这个函数呀.mysql> select * from user_accounting_history where rq>='20080725';ERROR 1054 (42S22): Unknown column 'rq' in 'where clause'mysql> select * from user_accounting_history where rq>='2008-7-25';ERROR 1054 (42S22): Unknown column 'rq' in 'where clause'mysql> yueliangdao0608, to_days(current_date),在我的理解是指当前的日期,但取出来的值7337171不是很明白.如下: mysql> select (now());+---------------------+| (now()) |+---------------------+| 2008-11-06 09:21:14 |+---------------------+1 row in set (0.00 sec)mysql> select to_days(current_date);+-----------------------+| to_days(current_date) |+-----------------------+| 733717 |+-----------------------+1 row in set (0.00 sec)mysql> wwwwb, 字段='日期'这种方法最早就试过了,不行.mysql> select * from user_accounting_history where call_start_time='2008-7-25';Empty set (0.46 sec)而这一天是有数据的. select * from 表 where to_days('字段名')='2008-07-25' to_days是把日期转换为一个数字select * from 表 where to_days('字段名')=to_days('2008-07-25') select to_days('时间字段名') from 表名; 急求解决方案。Load Data InFile 'C:/备份/Data.txt',load 语法不支持中文路径 Mysql自动递增列解决方法 mysql主从问题,线上业务,值得研究! 如何查询数据里的开始字段ID号和结束字段ID号? 着急!!!在postgres中插入字符串中含有“‘”单引号怎么处理 如何用vb6.0实现与mysql数据库的连接和添加操作? JAVA连接MYSQL求助 我用UPDATE更新某行某列的时候,它也帮我更新了我没指定的该行的某列~~ 查询最前5条记录? 查询效率问题,高手请进 MySql中插入特殊中文字符出错 用文本方式将数据装入数据库表中
ERROR 1054 (42S22): Unknown column 'rq' in 'where clause'
mysql> select * from user_accounting_history where rq>='2008-7-25';
ERROR 1054 (42S22): Unknown column 'rq' in 'where clause'
mysql>
+---------------------+
| (now()) |
+---------------------+
| 2008-11-06 09:21:14 |
+---------------------+
1 row in set (0.00 sec)mysql> select to_days(current_date);
+-----------------------+
| to_days(current_date) |
+-----------------------+
| 733717 |
+-----------------------+
1 row in set (0.00 sec)mysql>
Empty set (0.46 sec)而这一天是有数据的.
select * from 表 where to_days('字段名')=to_days('2008-07-25')