Trisiana
|
| Posted: 02/19/2004, 10:29 PM |
|
Hi, I got this error when I try to link table people and category using
category_id. I already tried to use field alias category_id1 and
category_id2 but still got the same error. Any help will be very nice...
====================
Form: Grid People
Error: Ambiguous column name 'category_id'. (Microsoft OLE DB Provider for
SQL Server)
|
|
|
 |
DonB
|
| Posted: 02/20/2004, 6:13 AM |
|
It's saying that the category_id appears in both tables and doesn't know
which one to reference. You need to alias the tables, not the column, and
specify the alias in your select;
SELECT p.category_id, c.category_id FROM people AS p, category AS c ON
p.category_id = c.caegory_id
--
DonB
http://www.gotodon.com/ccbth
"Trisiana" <trisiana.tana@lycos.co.uk> wrote in message
news:c149fe$uq8$1@news.codecharge.com...
> Hi, I got this error when I try to link table people and category using
> category_id. I already tried to use field alias category_id1 and
> category_id2 but still got the same error. Any help will be very nice...
> ====================
> Form: Grid People
> Error: Ambiguous column name 'category_id'. (Microsoft OLE DB Provider for
> SQL Server)
>
>
|
|
|
 |
Suntower
Posts: 225
|
| Posted: 02/09/2005, 12:10 PM |
|
I just got this error when I try to sort on any column that has a duplicate name in a joined table.
I -have- aliased all tables and column names in my SELECT statement. The only thing I can think of is that I'm using a SQL statement rather than a Table.
Any ideas?
TIA,
---JC
SELECT PRO.PRODUCTID, PRO.SPEC, PRO.FORMNUMBER, PRO.DESCRIPTION,
PRO.SELLUOFM, PRO.CATEGORY1, PRO.DEFAULTSALESRELEASEQUANTITY,
PRO.ONHANDQUANTITY,
PROI.FILENAME
FROM Products AS PRO LEFT OUTER JOIN ProductImages AS PROI ON PRO.ProductID = PROI.ProductID
WHERE PRO.InternalUseOnly<>1 AND PRO.FMS=1 AND PRO.CustomerID='00LETTUC'
_________________
---On a campaign for more examples and better docs! |
 |
 |
mrachow
Posts: 509
|
| Posted: 02/10/2005, 12:19 AM |
|
What happens when you use the unaliased column name for "ordering"?
_________________
Best regards,
Michael |
 |
 |
DonB
|
| Posted: 02/10/2005, 6:54 AM |
|
Try filling in the Sort Order property of your Sorters with the
fully-qualified column name. I would guess right now it's blank or just the
column name (without the table alias).
--
DonB
http://www.gotodon.com/ccbth
|
|
|
 |
Suntower
Posts: 225
|
| Posted: 02/10/2005, 9:48 AM |
|
Who's da man? YOU da man!
Cheers,
---JC
Quote DonB:
Try filling in the Sort Order property of your Sorters with the
fully-qualified column name. I would guess right now it's blank or just the
column name (without the table alias).
--
DonB
http://www.gotodon.com/ccbth
_________________
---On a campaign for more examples and better docs! |
 |
 |
|