I am trying to get counts for last 30 days with the following query -
SELECT date_occured, COUNT(*) FROM problem
WHERE date_occured >= (CURRENT_DATE - 30)
GRO
I would tend to suspect that Tony is correct and that you really only want to TRUNC
the right-hand side of the expression.
If you do want to TRUNC
both sides of the expression and you're encountering performance issues, you probably need a function based index
CREATE INDEX idx_problem_trunc_dt_occured
ON problem( trunc( date_occurred ) );
That would allow your original query to use the function-based index.