I have to select rows following some variables which will switch on or off some conditions, like:
SELECT *
FROM table
WHERE field =
CASE @param
WHEN NULL THEN field
ELSE @param
END
In another words.. I want to compare only if @param is not null, but my select doesn't work. How can I do it?
Thanks!
fieldhas aNULLvalue.