ORA-00904:"DATEPART":标示符无效
SELECT datepart(month,orderdate) as 月
,name
,sum(price) as 总金额
FROM testorders
where orderdate between '2009-1-1' and '2009-5-1'
group by datepart(month,orderdate),name;
------解决方案--------------------oracle 哪来的这个函数, to_char(orderdate,'mm')
------解决方案--------------------between to_date('2009-01-01','yyyy-mm-dd') and to_date('2014-05-01','yyyy-mm-dd'),
oracle中设计时间 字符串 可以用to_date ,to_char转换