Pregunta

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?

¿Fue útil?

Solución

You can use CASE expressions:

SELECT id, 
       CASE WHEN id IS NULL THEN 'true' ELSE 'false' END AS id_Description
FROM dbo.Table1
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top