Skip to Main Content
Card Uniform Size Change series label on graphs

Case statement in where clasue

How to use a case statement in a sql where clasue

Example

WHERE  ( 1 = CASE
        WHEN <column_a> != <column_b> AND <column_c> = 1 
           THEN
                 1
        WHEN <column_a> =  NVL( <column_b>, -1 )  
            THEN
                 1
        ELSE
                 0
        END 
       )