Возможность декларации условий в Microsoft SQL
Уважаемые знатоки MS SQL, подскажите пожалуйста про возможность декларации условий, как указано в примере ниже:
есть код вида:
select * from table where cond1=111 and cond222=222 and cond3=333
union all
select * from table where cond1=111 and cond222=222 and cond4=444
union all
select * from table where cond1=111 and cond222=222 and cond5=555
Есть ли возможность как то задекларировать повторяющееся условие в Microsoft SQL, чтобы получилось что-то вроде такого:
DECLARE @MyCondition AS varchar = 'cond1=111 and cond222=222
select * from table where @MyCondition and cond3=333
union all
select * from table where @MyCondition and cond4=444
union all
select * from table where @MyCondition and cond5=555