Mar 25, 2020 08:25 AM|Sean Fang|LINK
As you said that "I need to write it one time only meaning as below case when teamid=2 then date=getdata and parametric=2", I am afraid that
CASE WHEN could not be used in this way . If you would not like to use CASE WHEN , you can use
IFF to change your script . Logical
Functions - IIF (Transact-SQL)
But unfortunately, it still can't change to that repeat situation. According to the code you give now, I have no method to change your code at present. If forcing a change, it may make your code look more complicated.
Could you please share us your table structure and some sample data along with your expected result? These information might provide a right direction and I will make some test. Thanks in advance .