現在のSQL文 DELETE FROM TEBLE WHERE IF TO_CHAR(CURRENT_DATE,'MM') > '3' THEN 年度 <= TO_CHAR(CURRENT_DATE,'YYYY')-3 ELSE 年度 <= TO_CHAR(CURRENT_DATE,'YYYY')-4;
DELETE FROM TEBLE WHERE 年度 <= (SELECT CASE WHEN TO_CHAR(CURRENT_DATE,'MM') > '03' THEN TO_NUMBER(TO_CHAR(CURRENT_DATE,'YYYY')) - 3 ELSE TO_NUMBER(TO_CHAR(CURRENT_DATE,'YYYY')) - 4 END FROM DUAL)