Re: [SQL] three-way join - solved

2004-04-20 Thread Stijn Vanroye
First off, I'm sorry I couldn't get you a reply sooner. I see you have found another way, which is good :-) > I've sorted it. > > Firstly, I've done away with the status field. If an item's > been issued or is > still on order it does not have a location. I've therefore > set up two > loc

Re: [SQL] three-way join

2004-04-19 Thread Bruno Wolff III
On Mon, Apr 19, 2004 at 13:47:28 +0100, Gary Stainburn <[EMAIL PROTECTED]> wrote: > Hi folks, > > here's a straight forward join that I simply can't get my head round. > > I've got > > consumables: cs_id, cs_make, cs_comments > cons_locations: cl_id, cl_desc > cons_stock: cs_id, cl_id, statu

Re: [SQL] three-way join - solved

2004-04-19 Thread Gary Stainburn
On Monday 19 April 2004 4:01 pm, Gary Stainburn wrote: > On Monday 19 April 2004 3:06 pm, Stijn Vanroye wrote: > > Gary wrote: > > > Hi folks, > > > > > > here's a straight forward join that I simply can't get my head round. > > > > > > I've got > > > > > > consumables: cs_id, cs_make, cs_comm

Re: [SQL] three-way join

2004-04-19 Thread Gary Stainburn
On Monday 19 April 2004 3:06 pm, Stijn Vanroye wrote: > Gary wrote: > > Hi folks, > > > > here's a straight forward join that I simply can't get my head round. > > > > I've got > > > > consumables:cs_id, cs_make, cs_comments > > cons_locations: cl_id, cl_desc > > cons_stock: cs_id, cl_id, s

Re: [SQL] three-way join

2004-04-19 Thread Stijn Vanroye
Gary wrote: > Hi folks, > > here's a straight forward join that I simply can't get my head round. > > I've got > > consumables: cs_id, cs_make, cs_comments > cons_locations: cl_id, cl_desc > cons_stock: cs_id, cl_id, status (1=ordered, 2=in-stock) > > (one stock record per stock item, qty=3 m

[SQL] three-way join

2004-04-19 Thread Gary Stainburn
Hi folks, here's a straight forward join that I simply can't get my head round. I've got consumables:cs_id, cs_make, cs_comments cons_locations: cl_id, cl_desc cons_stock: cs_id, cl_id, status (1=ordered, 2=in-stock) (one stock record per stock item, qty=3 means 3 records) I'm struggling