I want to run through two IF statements in sql. The IF's are two different conditions, example:
IF (@user == 'Bob')
BEGIN
SELECT * FROM table Where id = 1
END
IF (@animal == 'Cat')
BEGIN
SELECT * FROM table WHERE id = 50
END
What i want back are rows 1 if only the first condition is correct or 1 and 50 if both conditions are met.
This fails at the second IF statement, is there another keyword I need to add?