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

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -