Is it possible in Oracle to put conditional IF statements in the WHERE clause?
I want to filter all rows with an end date before today. And if the end date is empty, it should not filter on it. I’ve tried this:
SELECT discount_amount
FROM vw_ph_discount_data
WHERE sysdate > start_date
AND
IF
end_date IS NOT EMPTY
THEN
sysdate < end_date
But I get “invalid relational operator”.
You can try: