[ale] Re: foreign key?
Jim Philips
jcphil at mindspring.com
Fri Jan 25 13:33:07 EST 2002
Apparently, Contributor_ID is in both tables. You need something like:
...where Item.Contributor_ID>1
On Fri, 2002-01-25 at 13:13, David S. Jackson wrote:
> On Fri, Jan 25, 2002 at 12:33:59PM -0500 Gurhan Ozen <c-gurhan.ozen at wcom.com> wrote:
> > Hi David,
> > First of all, whever you have a primary key on your table, do all updates
> > according to the primary key..
> > So whatever the primary key for the person you wanna do update, do
> > something like:
> > update Contributors set Contact_ID = 1, Volunteer_ID = 13 where
> > Contributor_ID=number;
> > Also since the columns are integer data type, don't use quotes around them.
> > I hope this helps..
>
> Yep, I removed the quotes, and it worked.
>
> Here's another problem: I think I'm doing an unintentional
> ambiguous select:
>
> mysql> select Item.Item_Description, Item.Retail_Value,
> Item.Bid_Description, Contributors.Name from Item, Contributors
> where Contributor_ID > 1;
>
> I get the error:
>
> ERROR 1052: Column: 'Contributor_ID' in where clause is ambiguous
>
> So, looking again at my definitions for Contributor_ID in both
> tables, I see they aren't exactly alike. Is there a way I can
> make Contributor_ID in Item refer back to the Index
> (Contributor_ID) in Contributors? I gather that just making the
> data types the same is not enough?
>
> TIA!
>
> --
> David S. Jackson dsj at dsj.net
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> I'm going to live forever, or die trying!
> -- Spider Robinson
>
> ---
> This message has been sent through the ALE general discussion list.
> See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
> sent to listmaster at ale dot org.
>
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list