I am making a database and I have been trying to get this done for a good amount of time.
SELECT clients.nombre, clients.zona
FROM developmentrequest,potentialclients, users
INNER JOIN clients ON clients.id_clients = developmentrequest.id_clients
INNER JOIN users ON clients.id_user = users.id
WHERE users.id =4 AND developmentrequest.id_states=3
UNION
SELECT potentialclients.nombre, potentialclients.zona
FROM developmentrequest,potentialclients, users
INNER JOIN potentialclients ON potentialclients.id_potentialclients = developmentrequest.id_potentialclients
INNER JOIN users ON potentialclients.id_user = users.id
WHERE users.id =4 AND developmentrequest.id_states=3
this is the code I have been working on and it gives the problem: #1066 - Not unique table/alias: 'potentialclients', now I have tried naming potentialclients with an alias like pc1 but it starts giving other errors with other columns, I dont know what to do :C