Ben Ben - 4 months ago 21
SQL Question

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

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

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