I have the following MySQL:
select `car`.`ID` AS `ID`,
`title`,`text`
from `car`
LEFT JOIN `truck` as bigcar ON bigcar.`ID` = `car`.`truckID`
WHERE `ID` ='1';
For some reason I’m getting
Column ‘ID’ in where clause is ambiguous
For complicated code reasons, I’m not renaming the alias as something else (such as ID2)
Shouldn’t this work?
You need to specify the table you are using for
idin your the where clause. Otherwise the query will know not which one to use since you have the same column name in two tablesor if you want the
bigcarID you will have to use: