SELECT DATE(eoa.DATETIME) AS Date_OF_Alert,
COUNT(*) AS Num
FROM ECMS_ONLINE_ALERTS eoa
GROUP BY DATE(eoa.DATETIME)
ORDER BY eoa.DATETIME
this my sql function i am getting error like
SQL Error [936] [42000]: ORA-00936: missing expression¶
how to resolve it
CodePudding user response:
see: Oracle SQL "SELECT DATE from DATETIME field "
use:
SELECT TRUNC(eoa.DATETIME) AS Date_OF_Alert,
COUNT(*) AS Num
FROM ECMS_ONLINE_ALERTS eoa
GROUP BY TRUNC(eoa.DATETIME)
ORDER BY TRUNC(eoa.DATETIME)