尽管我有正确的 table 名称,但字段列表中的列不明确
Column in field list is ambiguous despite I have correct table names
这是代码,理论上应该可以,对吧?但是当我运行这个的时候,错误就出现了
"#1052 - 字段列表中的列 'spotID' 不明确"
SELECT start, end, spotID FROM bookings
INNER JOIN glampingspot ON (bookings.spotID = glampingspot.spotID)
WHERE glampingspot.venueID = 1
AND glampingspot.maxPeople >= 3
是的,我 1000% 确定表的名称是“bookings”和“glampingspot”,并且它们具有相同的键“spotID”
SELECT start, end, bookings.spotID FROM bookings
INNER JOIN glampingspot ON (bookings.spotID = glampingspot.spotID)
WHERE glampingspot.venueID = 1
AND glampingspot.maxPeople >= 3
解析列的范围始终是一个好习惯,这样可以清楚输出中哪个列来自哪个table。
这是代码,理论上应该可以,对吧?但是当我运行这个的时候,错误就出现了
"#1052 - 字段列表中的列 'spotID' 不明确"
SELECT start, end, spotID FROM bookings
INNER JOIN glampingspot ON (bookings.spotID = glampingspot.spotID)
WHERE glampingspot.venueID = 1
AND glampingspot.maxPeople >= 3
是的,我 1000% 确定表的名称是“bookings”和“glampingspot”,并且它们具有相同的键“spotID”
SELECT start, end, bookings.spotID FROM bookings
INNER JOIN glampingspot ON (bookings.spotID = glampingspot.spotID)
WHERE glampingspot.venueID = 1
AND glampingspot.maxPeople >= 3
解析列的范围始终是一个好习惯,这样可以清楚输出中哪个列来自哪个table。