Hi, i m kinda new to firebird and i need to make a query where there is a possibility that the index of the relation of two tables could be null, so i used left outer join.. it worked in one case.. but now i need to make another query linking more then 2 tables and it isnt working.. here are my queries:
SELECT DISTINCT N.EMISSAO, N.CUPOM, N.OBS1, N.OBS3, V.DESCRICAO
FROM SIAD_VND N
LEFT OUTER JOIN SIAD_VED V ON (V.CODIGO = N.VEDEXT)
This one works...
But this one bellow isnt working 🙁
It gives me the results.. but the field V.DESCRICAO that comes from the left outer join just come blank.. my query looks like this:
SELECT DISTINCT N.PRAZO, I.NOME, N.CUPOM, N.OBS1, N.OBS3, V.DESCRICAO
FROM SIAD_VND N, SIAD_CLI I
LEFT OUTER JOIN SIAD_VED V ON (V.CODIGO = N.VEDEXT)
WHERE (I.CODIGO = N.CODCLI) AND (N.PRAZO >= '05/01/2005' AND N.PRAZO <= '06/01/2005')
I think that the problem lies here:
WHERE (I.CODIGO = N.CODCLI)
But i m kinda newbie in sql so i dont know if i can have more than one left outer join or if there is another solution to this problem.
The second query works, but the filed V.DESCRICAO just return blank values :glare:
Thanx in advance for any help