select year(register_time) as y from user where y>2005 运行报错
错误信息如下所示:
ERROR 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ERROR 1054 : Unknown column 'y' in 'where clause'' at line 1
字段类型是什么,如果是DATETIME
SELECT * FROM TT WHERE F1 BETWEEN '2009-11-1 00:00:15' AND '2009-11-05 12:12:11'
[/Quote]
如果在where 子句中包含 datetime类型,是否允许在 where 子句中使用MySQL日期函数,好像是不可以的,为什么?
字段类型是什么,如果是DATETIME
SELECT * FROM TT WHERE F1 BETWEEN '2009-11-1 00:00:15' AND '2009-11-05 12:12:11'
[/Quote]
select count(*) from table_name group by 月份
如何对datetime类型进行按月份的group统计操作呢?
求相应的SQL语句:)