I have the person table:
id nombre sexo
1 paco 1
2 elena 2
3 alien null
I have the table sex:
id genero
1 hombre
2 mujer
Starting from the bas that is a DB of the client that I can not touch, I make the following query:
select p.nombre as name, g.genero as gender from persona p, sexo g
where p.nombre = 'paco' and g.id = p.sexo ; => esto funciona sin problemas
DOUBT:
select p.nombre as name, g.genero as gender from persona p, sexo g
where p.nombre = 'alien' and g.id = p.sexo ;
= > this DOES NOT WORK, I guess it will be because of the null it has but how can I do to get results?