I'm trying to run 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, State 1, Line 2 The multi-part identifier "pendencia.id_pendencia" could not be associated.
I do not know where I'm going wrong, can anyone tell me what's wrong?
Follow the bank schema: