Reputation: 117
I need to count latest date records (REPORT_DATE column).
It will be very helpful if I get this in the where clause
Select count(*) FROM DATA_EXPORT WHERE
REPORT_DATE = MAX(REPORT_DATE)
ORA-00934: group function is not allowed here
Upvotes: 0
Views: 79
Reputation: 3396
try this one :
Select count(*)
FROM DATA_EXPORT
WHERE REPORT_DATE = (select MAX(REPORT_DATE) from DATA_EXPORT)
AND STATUS = 'Open'
Upvotes: 3