hi
I am getting following error while running the following sql. If i run inner query alone it is working fine. if i run the whole query it is giving
ORA-01858: a non-numeric character was found where a numeric was expected
01858. 00000 - "a non-numeric character was found where a numeric was expected"
*Cause: The input data to be converted using a date format model was
incorrect. The input data did not contain a number where a number was
required by the format model.
*Action: Fix the input data or the date format model to make sure the
elements match in number and type. Then retry the operation.
------------------------------------------------------
columns month and year are in varchar2(20) in the table abc. please help me to fix this.
SELECT month,year,SUM(price) FROM (
select
to_char (to_date(month,'dd-Mon YYYY'), 'YYYYMM') as month
,to_char (to_date(month,'dd-Mon YYYY'), 'YYYY') as year
,nvl(price,0) as price
FROM abc)
GROUP BY month,year;