I want to filter by @campId if not null, or return all if null
This compiles but does not work as intended:
declare @campId int
select *
from cli
where
cu in (
CASE @campId
when null then (select id from [dbo].[camp])
else @campId
end)
if cu is never null