Tom, try this query:
mysql> select d.id, d.name from department as d, department_item as di,
item as i where i.id=1 and i.id=di.item and d.id=di.department;
Replace the 1 with the ID of the item whose departments you are looking
for.
Leif
Tom Jakobsen wrote:
> Hi. I have spent several hours trying to figure out how to query the
> sql to showwhat department names a item belongs to. I only get the
> department number right. Im new at this, so if it is the easyest
> thing, dont laugh :) Please help i`m going crazy. Best regards Tom
--
-----------------------------------------------
Leif Mortenson
Silver Egg Technology
Kondo Ebisu Bldg. 802
1-20-8 Ebisu-nishi
Shibuya-ku, Tokyo 150-0021 JAPAN
Tel: 03-5456-8044
Fax: 03-3462-5045
Email: [EMAIL PROTECTED]
URL: http://www.silveregg.co.jp
-----------------------------------------------
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Site: http://www.working-dogs.com/freetrade/
Problems?: [EMAIL PROTECTED]