According to Microsoft:
syntax for searching is
[ WHERE <search_condition> ]*
And search condition is:
<search_condition> ::=
{ [ NOT ] <predicate> | ( <search_condition> ) }
[ { AND | OR } [ NOT ] { <predicate> | ( <search_condition> ) } ]
[ ,...n ]
And predicate is:
<predicate> ::=
{ expression { = | < > | ! = | > | > = | ! > | < | < = | ! < } expression
As you can see, you always have to write two expressions to compare.
Here search condition is boolean expression like 1=1, a!=b
Do not confuse search expressions with boolean constants like 'True' or 'False'. You can assign boolean constants to BIT variables
DECLARE @B BIT
SET @B='True'
but in TSQL you can not use boolean constants instead of boolean expressions like this:
SELECT * FROM Somewhere WHERE 'True'
It will not work.
But you can use boolean constants to build two-sided search expression like this:
SEARCH * FROM Somewhere WHERE 'True'='True'
IS TRUE
,IS UNKNOWN
, etc (though the SQL-99 Standard has both). A common workaround is to use aCHAR(1)
column constrainedCHECK (col1 IN ('T', 'F'))
.