查询错误 (1066):不唯一 table/alias:'useraccounts'
Error in Query (1066): Not unique table/alias: 'useraccounts'
我想从用户那里获取电子邮件和密码 table 其中电子邮件是主键,而对于电子邮件,我想从用户帐户中获取余额和帐户 ID,其中帐户 ID 是外键。针对那个外键,我想要来自 table accounts
的 accountNo
SELECT `user`.`email`, `user`.`passwrd`, `useraccounts`.`Balance`, `useraccounts`.`AccountID`, `accounts`.`AccountNo`
FROM `user` , `accounts`
LEFT JOIN `useraccounts` ON `user`.`email` = `useraccounts`.`email`
LEFT JOIN `useraccounts` ON `accounts`.`AccountID` = `useraccounts`.`AccountID`
SELECT `user`.`email`, `user`.`passwrd`, `useraccounts`.`Balance`, `useraccounts`.`AccountID`, `accounts`.`AccountNo`
FROM `user` , `accounts`
LEFT JOIN `useraccounts` ON `user`.`email` = `useraccounts`.`email`
LEFT JOIN `useraccounts` ON `accounts`.`AccountID` = `useraccounts`.`AccountID`
错误是 #1066- 不唯一 Table/Alias : useraccounts
enter image description here
'can u correct this query plz' - 也许这个
SELECT `user`.`email`, `user`.`passwrd`, `useraccounts`.`Balance`, `useraccounts`.`AccountID`, `accounts`.`AccountNo`
FROM `user`
LEFT JOIN `useraccounts` ON `user`.`email` = `useraccounts`.`email`
LEFT JOIN `accounts` ON `accounts`.`AccountID` = `useraccounts`.`AccountID`
我想从用户那里获取电子邮件和密码 table 其中电子邮件是主键,而对于电子邮件,我想从用户帐户中获取余额和帐户 ID,其中帐户 ID 是外键。针对那个外键,我想要来自 table accounts
的 accountNoSELECT `user`.`email`, `user`.`passwrd`, `useraccounts`.`Balance`, `useraccounts`.`AccountID`, `accounts`.`AccountNo`
FROM `user` , `accounts`
LEFT JOIN `useraccounts` ON `user`.`email` = `useraccounts`.`email`
LEFT JOIN `useraccounts` ON `accounts`.`AccountID` = `useraccounts`.`AccountID`
SELECT `user`.`email`, `user`.`passwrd`, `useraccounts`.`Balance`, `useraccounts`.`AccountID`, `accounts`.`AccountNo`
FROM `user` , `accounts`
LEFT JOIN `useraccounts` ON `user`.`email` = `useraccounts`.`email`
LEFT JOIN `useraccounts` ON `accounts`.`AccountID` = `useraccounts`.`AccountID`
错误是 #1066- 不唯一 Table/Alias : useraccounts
enter image description here
'can u correct this query plz' - 也许这个
SELECT `user`.`email`, `user`.`passwrd`, `useraccounts`.`Balance`, `useraccounts`.`AccountID`, `accounts`.`AccountNo`
FROM `user`
LEFT JOIN `useraccounts` ON `user`.`email` = `useraccounts`.`email`
LEFT JOIN `accounts` ON `accounts`.`AccountID` = `useraccounts`.`AccountID`