jeudi 21 juillet 2016

Contradictory condition checks on Where with a Case Statement

I want to check two Contradictory conditions on a WHERE clause for a same field using CASE;

If I extract the thing I want, shows below

WHERE FULFILMENT_STATUS_CODE != 'CNL'
WHERE FULFILMENT_STATUS_CODE = 'FUL'

They way I tried (and want) as follows, But I wonder how to have != in her

WHERE
    FULFILMENT_STATUS_CODE =
    CASE @pFILTER_TYPE
        WHEN 1 THEN 'CNL' 
        WHEN 2 THEN 'FUL' 
    END

Aucun commentaire:

Enregistrer un commentaire