Column in where clause is ambiguous - What does that mean?

Ben picture Ben · May 19, 2011 · Viewed 39.6k times · Source

I've come across this error in MySQL for the join clause but I'm fairly new to the JOIN argument and I'm not sure what this means. Can anyone help?

Column 'id' in where clause is ambiguous

SELECT * FROM (`venues`) 
JOIN `venues_meta` ON `venues_meta`.`venue_id` = `venues`.`id` 
WHERE `id` = '12'

Answer

Chris Morgan picture Chris Morgan · May 19, 2011

You need to fully qualify id because venues and venues_meta both have a column called id.