oracle - If statements in WHERE clause -
oracle - If statements in WHERE clause -
is possible in oracle set conditional if statements in clause?
i want filter rows end date before today. , if end date empty, should not filter on it. i've tried this:
select discount_amount vw_ph_discount_data sysdate > start_date , if end_date not empty sysdate < end_date
but "invalid relational operator".
you can try:
select discount_amount vw_ph_discount_data sysdate > start_date , sysdate < nvl(end_date,sysdate+1)
oracle
Comments
Post a Comment