There is behavior regarding JOIN that I can not understand.
I have two tables in these formats
Sick Table
ID_Doente Doente
1 Pedro
2 Paulo
3 Rui
Query table
ID_Consulta ID_Doente Tipo
1 2 Não Medica
2 2 Médica
And I'm doing a left join like this:
SELECT *
FROM Consulta
LEFT JOIN Doente
ON Consulta.ID_Doente =Doente.ID_Doente;
I was with the idea that the result would look something like this
ID_Consulta ID_Doente Tipo Doente
1 2 Não Medica Paulo
2 2 Médica Paulo
But I'm having this
ID_Consulta ID_Doente Tipo Doente
1 2 Não Medica Paulo
2 2 Médica NULL
Does anyone know the reason?
EDIT: This is an example of what is happening, I am accomplishing this using the merge left join functionality of Pentaho Kettle
EDIT2: The question was answered here link