我有這個存儲過程:內部連接在存儲過程
ALTER PROCEDURE [dbo].[Get_All_Items]
AS
BEGIN
SELECT
ItemID, ItemName, CategoryID, CountryID,
ItemSize, ColorID, ProductionDate, ExpiryDate,
UnitName, FirstUnitBarcode, FirstItemQuantity,
FirstUnitDefult, FirstUnitLimit,
UnitsTbl.SecondUnit, SecondUnitBarcode, SecondItemQuantity,
SecondUnitDefult, SecondUnitLimit,
ThirdUnit, ThirdUnitBarcode, ThirdItemQuantity,
ThirdUnitDefult, ThirdUnitLimit, UnitDefult,
ItemImage, ItemStatus, ItemsMainTbl.Nots,
ItemsMainTbl.CreatedBy, ItemsMainTbl.CreatedDate,
ItemsMainTbl.ModifiedBy, ItemsMainTbl.ModifiedDate
FROM
ItemsMainTbl
INNER JOIN
UnitsTbl ON ItemsMainTbl.FirstUnit = UnitsTbl.UnitID
INNER JOIN
UnitsTbl ON ItemsMainTbl.SecondUnit = UnitsTbl.UnitID
END
條件:
- ItemsMainTbl.FirstUnit = UnitsTbl.UnitID
- ItemsMainTbl.SecondUnit = UnitsTbl.UnitID
- ItemsMainTbl .ThirdUnit = UnitsTbl.UnitID
如何連接該公共列上的所有三個表?
我只拿到了第一個
ItemsMainTbl.FirstUnit = UnitsTbl.UnitID
感謝
與VB.NET無關,與Visual Studio無關。今後請使用正確的標籤。 – Bugs
塞勒姆,描述你的表中的字段。不可能理解'Iam Not Getting This UnitName' – Ingaz