Question

Pourquoi est-ce la requête MySQL ci-dessous donne 1066 (Not unique table/alias: 'customer') d'erreur?

SELECT customer.id, customer.firstName, account.id
FROM customer, account
INNER JOIN customer
ON customer.id = account.customerId 
ORDER BY customer.id
Était-ce utile?

La solution

Vous avez énuméré la table customer deux fois dans votre déclaration de FROM. Voici la version fixe:

SELECT customer.id, customer.firstName, account.id
FROM account
INNER JOIN customer
ON customer.id = account.customerId
ORDER BY customer.id
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top