Re: again with SELECT

2003-06-12 Thread danchik
t; <[EMAIL PROTECTED]> To: "Kevin Fries" <[EMAIL PROTECTED]>; "gamin" <[EMAIL PROTECTED]>; "danchik" <[EMAIL PROTECTED]>; "Fred Whipple" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, June 12, 2003 3:59 PM Subject:

RE: again with SELECT

2003-06-12 Thread Mike Hillyer
evin Fries [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 4:51 PM To: 'gamin'; 'danchik'; 'Fred Whipple'; [EMAIL PROTECTED] Subject: RE: again with SELECT Normally (this is what most ppl would think), for a given item you have one single unique color, bu

RE: again with SELECT

2003-06-12 Thread Kevin Fries
listed, *unless* an item can be listed in a color More than once. In that case, it'll return false rows. Kevin -Original Message- From: gamin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 3:33 PM To: danchik; Fred Whipple; [EMAIL PROTECTED] Subject: Re: again with S

Re: again with SELECT

2003-06-12 Thread Keith C. Ivey
On 13 Jun 2003 at 4:02, gamin wrote: > To each colorID you assign a unique prime number (maintain this in a > table). For each itemID now you have a unique colorPRODUCT (product of > the prime numbers coressponding the various colorIDs for this itemID). > To add a colorID to an itemID simply mulip

Re: again with SELECT

2003-06-12 Thread gamin
> thats effectively an OR statement, isnt it? > > how would i select the itemsIDs that have all the requested colors? > > for example if data was: > id:colorID:itemID > - > 11 1 > 21 2 > 3

Re: again with SELECT

2003-06-12 Thread Fred Whipple
Ah, I see what you mean, I misunderstood before. In this case, I would tend to reevaluate my table structure since you're inherently giving a key (colorID) more than one possible value (1 or 2) at the same time. There could be something you could do with DISTINCT but I can't think exactly how

Re: again with SELECT

2003-06-12 Thread danchik
lt;[EMAIL PROTECTED]> Sent: Thursday, June 12, 2003 2:47 PM Subject: Re: again with SELECT > danchik wrote: > > coming back to my earlier question but much more simplified portion of it :) > > > > > > I the following table : > > > > theTable > > --

Re: again with SELECT

2003-06-12 Thread gamin
Hi, > how do I select all itemIDs that have colorID = 1 and colorID = 2 and > colorID = 3 ... and colorID = N ? > Try this SELECT itemID FROM theTable WHERE colorID IN (1,2,3,...,N); G -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: again with SELECT

2003-06-12 Thread Fred Whipple
danchik wrote: coming back to my earlier question but much more simplified portion of it :) I the following table : theTable --- ID | int (key) colorID | int itemID | int --- how do I select all itemIDs that have colorID = 1