我有一张金属桌子
原文链接:https://www.f2er.com/sqlite/197795.htmlMetalID integer MetalName text MetalCode text
物品表
ItemID integer ItemName text ... Metal1 int Ref.-> Metals.MetalID Metal2 int Ref.-> Metals.MetalID Metal3 int Ref.-> Metals.MetalID
我试图选择三个MetalCodes
SELECT m.MetalCode as 'Metal1',m.MetalCode as 'Metal2',m.MetalCode as 'Metal3' FROM Item as k INNER JOIN Metals AS m ON m.MetalID=k.Metal1 INNER JOIN Metals AS m ON m.MetalID=k.Metal2 INNER JOIN Metals AS m ON m.MetalID=k.Metal3 WHERE k.ItemID=?
看起来我完全错了.请帮忙.