Question

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?

Was it helpful?

Solution

You can use CASE expressions:

SELECT id, 
       CASE WHEN id IS NULL THEN 'true' ELSE 'false' END AS id_Description
FROM dbo.Table1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top