SQL Server - boolean literal?

前端 未结 13 910
深忆病人
深忆病人 2020-12-04 22:56

How to write literal boolean value in SQL Server? See sample use:

select * from SomeTable where PSEUDO_TRUE

another sample:



        
13条回答
  •  心在旅途
    2020-12-04 23:43

    You should consider that a "true value" is everything except 0 and not only 1. So instead of 1=1 you should write 1<>0.

    Because when you will use parameter (@param <> 0) you could have some conversion issue.

    The most know is Access which translate True value on control as -1 instead of 1.

提交回复
热议问题