martes, 31 de julio de 2012

Select null y valores

Una sencilla forma para obtener valores null en una consulta junto con valores diferentes de null,

select (case when tabla.campo is null then 'null' else tabla.campo end) as mi_dato
from
tabla
having mi_dato in (0,1,2,'null')

Sds,

J

No hay comentarios:

Publicar un comentario