Victor Subervi 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
From which table did you want the ID value of? Did you want to know
SELECT categories.ID, item
or
SELECT products.ID, item
for your results? When there is a duplication like this, you must be
specific as MySQL can do many things but the ability to read the minds
of its DBA's is not one of them.
Respecfully,
--
Shawn Green, MySQL Senior Support Engineer
Sun Microsystems, Inc.
Office: Blountville, TN
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org