List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:January 25 2002 7:22pm
Subject:Re: foreign key?
View as plain text  

David S. Jackson wrote:

>On Fri, Jan 25, 2002 at 12:33:59PM -0500 Gurhan Ozen <c-gurhan.ozen@stripped>
> 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
>>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;
WHERE Item.Contributor_ID = Contributors.Contributor_ID and 
Item.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?

foreign key?David S. Jackson25 Jan
  • Re: [ale] foreign key?Vaidhy Mayilrangam25 Jan
  • Re: foreign key?Gerald Clark25 Jan
  • Re: foreign key?DL Neil25 Jan
Re: foreign key?David S. Jackson25 Jan
RE: foreign key?Rick Emery25 Jan