4
Answers

why i am getting error?

Gagan Sharma

Gagan Sharma

7y
304
1
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 . 
 
Answers (4)