1
I’m trying to execute the following command:
SELECT * FROM pendencia, cliente
LEFT JOIN servico ON pendencia.id_pendencia = servico.id_pendencia
LEFT JOIN cidade ON cliente.id_cidade = cidade.id_cidade
WHERE cliente.id_cliente = pendencia.id_cliente AND servico.ativo = 1
And SQL Server returns me the following error:
Message 4104, Level 16, Status 1, Line 2 Multi-part identifier "pendencia.id_pendencia" could not be associated.
I don’t know where I’m going wrong, someone can tell me what’s wrong?
Follows the bank’s schematic:
I’m not sure, but maybe it has something to do with you mixing
JOIN
s with,
when listing the tables. Try placing the tablecliente
asINNER JOIN
(and part ofWHERE
would go to theON
of that JOIN).– bfavaretto