Re: How do I select 'all related' in a many-to-many relation?

2003-02-25 Thread Mac
Harald Fuchs wrote: > That's easy: [Excellent MySQL code example snipped] Thanks, that was exactly what I was looking for. /mac - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://li

Re: How do I select 'all related' in a many-to-many relation?

2003-02-20 Thread Mac
Thanks for your reply, Diana Soares wrote: > > Selecting manufacturers from just one color with join works like a charm. > > (IIRC, untested code:) > > > > SELECT DISTINCT ca.Manufacturer, co.Name FROM car_color_links as l > > JOIN colors as co ON (co.ID = l.color_ID)

Re: How do I select 'all related' in a many-to-many relation?

2003-02-20 Thread Diana Soares
Hi, On Thu, 2003-02-20 at 13:20, Mac wrote: > Hi, > > I am using MySQL v3.23 and have a many-to-many relationship (cars <-> > colors) that I have broken up into three tables as follows > > cars: > ID Manufacturer > 1 Volvo > 2 BMW > 3 Toyota

How do I select 'all related' in a many-to-many relation?

2003-02-20 Thread Mac
Hi, I am using MySQL v3.23 and have a many-to-many relationship (cars <-> colors) that I have broken up into three tables as follows cars: ID Manufacturer 1 Volvo 2 BMW 3 Toyota colors: ID