Having a problem with a WHERE search statement would like to use a construction like..
WHERE f.foo IN
CASE @bar
WHEN 'BAR' THEN
('FOO','BAR',BAZ')
WHEN 'BAZ' THEN
('FOOBAR','FOOBAZ')
END
or
WHERE CASE @bar
WHEN 'BAR' THEN
f.foo IN ('FOO','BAR',BAZ')
WHEN 'BAZ' THEN
f.foo IN ('FOOBAR','FOOBAZ')
END
where @bar is a well defined temp variable of the correct type and all that
f is defined nicely..
I get an error about “Error at ‘,’
1 Answer