In Sql Server when i run query :
Select Case when 5>2 then 1
else 2 end
its working perfectly, But when i run the below query its showing error ?
Query : Select 5 > 2
Output:
Msg 102, Level 15, State 1, Line 17
Incorrect syntax near '>'.
Why error ? instead of displaying True or false or 1 or 2? on comparison .


Nilesh ShahRank #42 · 34.2K reputationPosted May 19, 2017, 6:41 AM EDT
Guest UserRank #816 · 2.8K reputationPosted May 16, 2017, 1:39 AM EDT
Nilesh ShahRank #42 · 34.2K reputationPosted May 18, 2017, 7:45 AM EDT
Gagan SharmaRank #866 · 2.5K reputationPosted May 18, 2017, 8:14 PM EDT