My code is below
it returns me "h.banco as the bank" with a number, which is foreign key
I want it to return the description of this bank, but in many cases, the bank returns me as null
How do I mount the from clause to this?
I tried to put another left join
only that it returned the same record to me again
select a.numero,
a.competencia,
d.area as setor,
c.nome as nomeprojeto,
e.especificacao as elemento,
e.codigo as codigoelemento,
f.descricao as rubr,
f.rubrica as codigorubrica,
a.valorestimado,
a.observacao,
a.fonterecurso codigofonte,
g.descricao fonte,
a.competenciadespesa,
h.nome as credor ,
h.documento as doccredor,
h.tipopessoa as tipocredor,
h.banco as banco,
h.contacorrente as contacorrente,
h.agencia as agencia,
a.processo,
a.finalidade as objetoSad,
a.datainclusao,
a.datamod
from sad a left join credor h on a.credor = h.codigo,
cronograma b,
projeto c,
organograma d,
elementodespesa e,
rubrica f,
fonterecurso g
where a.cronograma = b.codigo
and b.projeto = c.codigo
and c.organograma = d.codigo
and b.rubrica = f.codigo
and f.elementodespesa = e.codigo
and a.fonterecurso = g.codigo
and a.codigo = 1954