![](/img/trans.png)
[英]Why am I Getting an Ambiguous Column name CountryID error message when trying to execute this SQL statement:
[英]I am trying to do a join table and I am getting ambiguous column error
我想加入兩個表、聯系人和組。 我想從聯系人中的組列與組中的組列匹配的聯系人中獲取 firstName 列。 當我輸入我的聲明時,聯系人中的任何一列都說它是模棱兩可的。
cursor.execute('SELECT groups.groups FROM contacts, groups LEFT JOIN contacts ON contacts.groups = groups.groups')
您兩次包含聯系人表,我認為您應該這樣做
select contacts.firstname
from contacts
left join groups
on contacts.groups=groups.groups
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.