I have a query I want to work with the following logic (knowing full well it won't work as written):
select *
From orders
Where if Value1 != 'TEST'
(Value1 = @1)
Else if Value2 != 'TEST'
(Value2 = @2)
Else 1=2
I don't think I can use a Case...When
or iif
since the value to filter the query on changes based on the outcome of condition. Any ideas?