I have a case statement like –
Case FormID
When '1025' Then 'QFormName' (These are sub queries)
When '3026' Then 'DFormName'
Else 'FormName' End 'FormName'
Case FormID
When '1025' Then 'QDFormName' (These are sub queries)
When '3026' Then 'DDFormName'
Else 'DFormName' End 'DisplayFormName'
I got another statement like this as well.
Is there any way to simplify this SQL using CTE on the top of statement.
Where I can do something like –
Case FormID
When '1026' SET QFormName, SET QDFormName
Mean logically i can check formID at one place and find all the three values I want to find.
Thanks,
If I understand what you want you can do this by declaring a variable and using a batch. (More than one sql statement in a row.)
Any chance you can show the full query or a simplified version that shows the issue — it is easier to explain if I know exactly what you are doing.