try (didn't test, so it might not work):select Stuff.StuffName, Item.ItemName
from Relation, Stuff ,Item
where Relation.StuffID = Stuff.StuffID and Item.ItemID = Relation.ItemID
and Stuff.DepartID = 1

解决方案 »

  1.   

    select Stuff.StuffName, [item].ItemName from [Relation] 
    left outer join Stuff on [Relation].stuffid=stuff.id
    left outer join [item] on [Relation].Itemid=[item].itemid
     where [Relation].StuffID in (select StuffID from [Stuff] where DepartID=1)
      

  2.   

    SELECT a.StuffName, b.ItemName
    FROM Stuff a,Item b,Relation c
    WHERE c.StuffID IN (select d.StuffID from Stuff d where d.DepartID=1) 
          AND a.StuffID=c.StuffID
          AND b.ItemID=c.ItemID
      

  3.   

    select stuff.name , item.itemname
    from relation , stuff , item
    where relation.stuffid = stuff.stuffid
    and relation.itemID = item.itemId
    and stuff.departID = 1  (写SQL的关键是找出MASTER表,在这个例子中,MASTER表是relation)
      

  4.   

    谢谢大家,龙飞虎和思归的写法是一样的,大件的写法,我最明白,还有梦锦的写法应该是用了join,但是我不太熟悉,我会努力的!