문제

i have this values in my table:

id
-----    
1    
2
null
3
4
null
5

Now I want to run a command similar to the following command:

select id==null from table

And the output should be as follows:

id
-----    
false
false
true
false
false
true
false

How do?

도움이 되었습니까?

해결책

You can use CASE expressions:

SELECT id, 
       CASE WHEN id IS NULL THEN 'true' ELSE 'false' END AS id_Description
FROM dbo.Table1
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top