Hello!
I'm getting a syntax error when I try to put a CSE statement inside my FROM clause... is this possible?
Basically I want the query to use a different table depending on the @service parameter that the user inputs.
select column1, column2, ...
from
(CASE
WHEN @service = 'AV' THEN 'no_sav'
WHEN @service = 'ISS' THEN 'no_iss'
WHEN @service = 'SMS' THEN 'no_sms'
END)
where ...
Thanks,
Dan
I'm getting a syntax error when I try to put a CSE statement inside my FROM clause... is this possible?
Basically I want the query to use a different table depending on the @service parameter that the user inputs.
select column1, column2, ...
from
(CASE
WHEN @service = 'AV' THEN 'no_sav'
WHEN @service = 'ISS' THEN 'no_iss'
WHEN @service = 'SMS' THEN 'no_sms'
END)
where ...
Thanks,
Dan