I have an SQL-query where I use Oracle CASE to compare if a date column is less than or greater than current date. But how do I use that
CASE
select (case when exp_date > sysdate then 1 when exp_date <= sysdate then 2 else 3 end) expired, count(*) from mytable group by (case when exp_date > sysdate then 1 when exp_date <= sysdate then 2 else 3 end)