本文介绍了不是唯一的表/别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

我不知道这是怎么回事.

I cant figure out whats wrong with it.

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';

推荐答案

尝试

    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';

这篇关于不是唯一的表/别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 10:15