SELECT *
FROM kk_gzhita
WHERE ymd >
CASE
WHEN han IN (1, 3, 4) THEN 20240831
WHEN han IN (7, 10, 11) THEN 20240930
ELSE 20240731
END;
SELECT *
FROM kk_gzhita
WHERE ymd >
CASE
WHEN han IN (1, 3, 4) THEN 20240831
WHEN han IN (7, 10, 11) THEN 20240930
ELSE 20240731
END;