Good evening,
I have below the search in the database, but it returns me error or does not work on line 4 where it says "JOIN contracts co ON c.email! = co.email", has how to do otherwise, or improve the search? Thanks
SELECT os.osID, c.nome, c.email, os.idioma, os.dataAtualizacao
FROM os
JOIN cadastroCliente c ON os.idcliente = c.cadastroClienteID AND c.email != ''
JOIN contratos co ON c.email != co.email
WHERE os.status = '1'
AND os.respondido = '1'
AND os.emailAutRecuperar1 = '0'
AND os.dataAtualizacao < CURRENT_DATE()-3
GROUP BY osID