3
I’m using the remote select
down below:
select
f.no_equipe,
h.no_pessoa_fisica,
a.no_cidadao,
d.dt_ficha
from
tb_cds_cad_individual a,
tb_cds_atend_individual b,
rl_cds_atend_individual_ciap c,
tb_cds_ficha_atend_individual d,
tb_equipe f,
tb_cds_prof g,
tb_pessoa_fisica h
where f.nu_ine = g.nu_ine
and g.nu_cns = h.nu_cns
and d.co_cds_prof = g.co_seq_cds_prof
and a.nu_cns_cidadao = b.nu_cartao_sus
and b.co_seq_cds_atend_individual = c.co_cds_atend_individual
and b.co_cds_ficha_atend_individual = d.co_seq_cds_ficha_atend_indivdl
and c.co_ciap = 727
and d.dt_ficha >= '2017-08-01'
and d.dt_ficha <= '2017-08-30'
In this code he returns me 4 fields: team name, professional name, citizen name and date of the form.
My problem is on the line and a.nu_cns_cidadao = b.nu_cartao_sus
where it only shows the line if the number of your card is equal to the number recorded in another table.
I want to change the code so that even if the condition and a.nu_cns_cidadao = b.nu_cartao_sus
is not true, it lists the result and in place in the citizen’s name a.no_cidadao
something like "NO NAME".
I hope you understand.
I believe @Sorack’s response is the most appropriate to your case :)
– mbranbilla