Re: Limiting results from joins

2006-06-12 Thread Michael Stassen
Kim Christensen wrote: > Hey list; > > Consider this statement: > > SELECT * FROM products p, manufactors m, items i WHERE p.manufactor_id > = m.manufactor_id && p.product_id = i.product_id; > > Now, each unique product_id from "products" can have more than one > entry in the "items" table, but I

RE: Limiting results from joins

2006-06-12 Thread Peter Lauri
want the latest date, then you do ORDER BY i.item_updated DESC GROUP BY i.product_id -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kim Christensen Sent: Monday, June 12, 2006 9:15 PM To: Peter Lauri Cc: MySQL List Subject: Re: Limiting results from join

Re: Limiting results from joins

2006-06-12 Thread Kim Christensen
On 6/12/06, Peter Lauri <[EMAIL PROTECTED]> wrote: -- Here's what it looks like right now: SELECT * FROM products p INNER JOIN manufactors m ON m.manufactor_id = p.manufactor_id INNER JOIN items i ON i.product_id = p.product_id The problem is, that each entry in "produc

RE: Limiting results from joins

2006-06-12 Thread Peter Lauri
-- Here's what it looks like right now: SELECT * FROM products p INNER JOIN manufactors m ON m.manufactor_id = p.manufactor_id INNER JOIN items i ON i.product_id = p.product_id The problem is, that each entry in "products" may occur more than once in "items", and they are

Re: Limiting results from joins

2006-06-12 Thread Kim Christensen
On 6/12/06, Barry <[EMAIL PROTECTED]> wrote: Kim Christensen schrieb: > Hey list; > > Consider this statement: > > SELECT * FROM products p, manufactors m, items i WHERE p.manufactor_id > = m.manufactor_id && p.product_id = i.product_id; > > Now, each unique product_id from "products" can have mo

Re: Limiting results from joins

2006-06-12 Thread Kim Christensen
On 6/12/06, Barry <[EMAIL PROTECTED]> wrote: Kim Christensen schrieb: > Hey list; > > Consider this statement: > > SELECT * FROM products p, manufactors m, items i WHERE p.manufactor_id > = m.manufactor_id && p.product_id = i.product_id; > > Now, each unique product_id from "products" can have mo

Re: Limiting results from joins

2006-06-12 Thread Barry
Kim Christensen schrieb: Hey list; Consider this statement: SELECT * FROM products p, manufactors m, items i WHERE p.manufactor_id = m.manufactor_id && p.product_id = i.product_id; Now, each unique product_id from "products" can have more than one entry in the "items" table, but I only want to