Is there a ternary conditional operator in T-SQL?

sql-server, t-sql

Solution

Use `case`:

select *
from table
where isExternal = case @type when 2 then 1 else 0 end

Problem

What are alternatives to implement the following query: ``` select * from table where isExternal = @type = 2 ? 1 : 0 ```

Original source