Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんなことをしたい。
declare @var1 as integer Select * from table name where id If @var1 = 1 then 21 elseif @var1 = 2 <>21
私が知りたいのは、これが可能かどうかだけです。変更する必要があるのは比較演算子だけです。
where ( @var1 = 1 and id = 21) or (@var1 = 2 and id <> 21)