Re: a difficult join query question

2005-09-02 Thread SGreen
Klemens Ullmann <[EMAIL PROTECTED]> wrote on 09/02/2005 07:37:43 AM: > hello! > > I've got two tables for an IT hardware inventory: > > ### table inventory: > invid model > --- > 1001 HP Notebook// no attributes > 1002 Dell Desktop // only one attribut 'pc-name' > 1003

Re: a difficult join query question

2005-09-02 Thread Devananda
Klemens Ullmann wrote: hello! I've got two tables for an IT hardware inventory: ### table inventory: invid model --- 1001 HP Notebook// no attributes 1002 Dell Desktop // only one attribut 'pc-name' 1003 Acer Laptop// attributes 'pc-name' & 'harddisk' 1004 App

Re: a difficult join query question

2005-09-02 Thread Dobromir Velev
Hi, I would rather put the attributes.attribute='pcname' in the join clause It should look something like this SELECT inventory.invid,inventory.model,attributes.value as pcname FROM inventory LEFT JOIN attributes ON (inventory.invid=attributes.invid and attributes.attribute='pcname' );

a difficult join query question

2005-09-02 Thread Klemens Ullmann
hello! I've got two tables for an IT hardware inventory: ### table inventory: invid model --- 1001 HP Notebook// no attributes 1002 Dell Desktop // only one attribut 'pc-name' 1003 Acer Laptop// attributes 'pc-name' & 'harddisk' 1004 Apple iBook// only one