0
Hello, how are you?
This is my query:
SELECT cf.id_clifor,
cf.nome,
lv.localvenda,
ed.cidade,
ctt.telefone,
cf.descontoglobal,
lv.id_localvenda
FROM ((tbl_clientes_fornecedores AS cf
INNER JOIN tbl_local_de_venda AS lv
ON cf.id_localvenda = lv.id_localvenda)
LEFT JOIN tbl_enderecos AS ed
ON cf.id_clifor = ed.id_clifor)
LEFT JOIN tbl_contatos_clientes AS ctt
ON cf.id_clifor = ctt.id_clifor
WHERE (( ( cf.status ) = 'ATIVO' ))
ORDER BY cf.nome;
The results are like this:
The point is that in tbl_contacts_clients and tbl_addresses, you may have more than one phone/address, but I would like the results to return me only 1 single record. I tried DISTINCT and a few more things without success. I use ACCESS.
Thanks for the help.
then you need to group, the
group by
will solve this, see this, can help: https://answall.com/a/228296/57220– Ricardo Pontual
good, it worked, thank you
– Fabio Gomes