I have a table with the following schema:
| ID | BUNDLE_ID | IS_ADMIN |
I need to select data from the above table having an AND clause on the basis of certain criteria, i.e
IF @FLAG = 1
SELECT *
FROM TABLE A
WHERE A.IS_ADMIN = 1 AND BUNDLE_ID IN (3, 5)
ELSE
SELECT *
FROM TABLE A
WHERE A.IS_ADMIN = 1 AND BUNDLE_ID IN (1, 2)
Can I achieve this in a single query?