如何理解非唯一表/别名?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (26)

我收到错误 ERROR 1066 (42000): Not unique table/alias:

我无法弄清楚它有什么问题。

SELECT Project_Assigned.ProjectID, Project_Title, Account.Account_ID, Username, Access_Type
FROM Project_Assigned 
JOIN Account 
  ON Project_Assigned.AccountID = Account.Account_ID
JOIN Project
  ON Project_Assigned.ProjectID = Project.Project_ID
where Access_Type = 'Client';
提问于
用户回答回答于

试一试;s

    SELECT pa.ProjectID, p.Project_Title, a.Account_ID, a.Username, a.Access_Type, c.First_Name, c.Last_Name
      FROM Project_Assigned pa
INNER JOIN Account a
        ON pa.AccountID = a.Account_ID
INNER JOIN Project p
        ON pa.ProjectID = p.Project_ID
INNER JOIN Clients c
        ON a.Account_ID = c.Account_ID
     WHERE a.Access_Type = 'Client';
用户回答回答于
 select persons.personsid,name,info.id,address
    -> from persons
    -> inner join persons on info.infoid = info.info.id;

扫码关注云+社区

领取腾讯云代金券