On Fri, Oct 2, 2009 at 10:53 AM, Victor Subervi <victorsube...@gmail.com>wrote:

> Hi;
> I get the following error:
>
> *SQL query:*
>
> SELECT ID, Item
> FROM products
> JOIN categories ON categories.ID = products.Category
> LIMIT 0 , 30;
>
>  *MySQL said:*
>  #1052 - Column 'ID' in field list is ambiguous
>
> Please note the error is about ambiguity. "products" has an ID field and so
> does "categories". If I run the statement taking out the "ID" from the
> select, it runs. So, where is the ambiguity??
> TIA,
> V


Just prefix the ID with either table name like products.ID or categories.ID.

David

Reply via email to