How to execute "select bool expression", like select 1>0 in Mysql?
select 1>0 cause a compile error in SQL server.
Use a CASE statement
SELECT CASE WHEN 1>0 THEN 'TRUE' ELSE 'FALSE' END;
there's no real Boolean datatype to use, so you'd be using the output as a decision point. Might not save you time versus comparing actual value to expected value within an IF structure to begin with.
You could put this into a function if you wanted to, and use that to evaluate your two values.
19 People are following this question.