Hi,
I wonder if i can use IF-ELSE in 'With' clause; as follows
;WITH TEST
AS(
--my select statement
)
IF parameter >0
BEGIN
--select statement on TEST with some condition
END
ELSE
BEGIN
--select statement on TEST with some other condition
END
I tried the same but i got Syntax error message.
Is the scenario possible or i shall use a temp table?
Please Suggest.
Thank you,
Shubham
shubham