SQL Server null size judgment

In SQL Server, if a selected field is empty (or the data does not exist), then when you make a greater or lesser judgment on the field, the result must be false

declare @ID int

set @ID = null;
if @ID >1
select @ID AS trueID
ELSE select @ID falseID

set can be replaced with select @ID = ID from Test where ID =1; such a statement, the results are

falseID
NULL

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325778873&siteId=291194637