select * from aa where date_format(ReportTime,%Y-%m-%d')='2010-08-26';
select * from aa where ReportTime = 'xxx' 这种方法好像也是可以的。大家有谁整理过这些。
select * from 表 where date(ReportTime)=CURDATE()
select * from aa where date_format(ReportTime,'%Y-%m-%d %H:%i') = date_format('xxx','%Y-%m-%d %H:%i');
flowdb=# select * from groupflowstatdu where date_format(ReportTime,'%Y-%m-%d %H:%i') = date_format('2010-08-24 00:00','%Y-%m-%d %H:%i'); ERROR: function date_format(timestamp without time zone, unknown) does not exist LINE 1: select * from groupflowstatdu where date_format(ReportTime,'... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.楼上的会报错 什么意思
'%Y-%m-%d %H:%i' 时期不能用通配符吗?
select * from aa where date_format(ReportTime,'%Y-%m-%d %H:%i') = date_format(now(),'%Y-%m-%d %H:%i');
这种方法好像也是可以的。大家有谁整理过这些。
select * from aa where date_format(ReportTime,'%Y-%m-%d %H:%i') = date_format('xxx','%Y-%m-%d %H:%i');
ERROR: function date_format(timestamp without time zone, unknown) does not exist
LINE 1: select * from groupflowstatdu where date_format(ReportTime,'...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.楼上的会报错 什么意思