开发者

Why does this SQL code give error 1066 (Not unique table/alias: 'customer')?

开发者 https://www.devze.com 2022-12-24 12:49 出处:网络
Why does the MySQL query below give error 1066 (Not unique table/alias: \'customer\')? SELECT customer.id, customer.firstName, account.id

Why does the MySQL query below give error 1066 (Not unique table/alias: 'customer')?

SELECT customer.id, customer.firstName, account.id
FRO开发者_运维知识库M customer, account
INNER JOIN customer
ON customer.id = account.customerId 
ORDER BY customer.id


You have listed the table customer twice in your FROM statement. Here's the fixed version:

SELECT customer.id, customer.firstName, account.id
FROM account
INNER JOIN customer
ON customer.id = account.customerId
ORDER BY customer.id
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号