I have a SP that gives me a lot of hard times.
The sp gets a two parameters @madeByUserId and @reportedByUserId. I want to have something like:
select
Add an if statement
IF (@reportedByUserId IS NOT NULL)
SELECT * FROM table t WHERE t.MadeByUserId = madeByUserId etc