I want to check if a boolean is true, then decide in the WHERE clause what condition to use.
Say the boolean variable is @checkbool:
SELECT *
FROM TableA A
WHERE
--if @checkbool is true, run this
A.Id = 123
--if @checkbool is false, run this
A.Id <> 123
Is there a way to negate a condition? Like in C++ you can do if !(condition).
If not, what is the best way to solve this problem?
Thank you!