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
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
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' );
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