我们说我有一个ITEMID,我想知道每个地方的现有数量。我被告知我需要使用INVENTITEMLOCATION表和INVENTSUM表。但是,似乎没有明显的方法来加入表格以获得我需要的东西。什么表和/或键链接我提到的两个表?
SELECT l.WMSPICKINGLOCATION
,s.PHYSICALINVENT
FROM INVENTITEMLOCATION l
INNER JOIN ?????? i
ON l.??? = i.???
INNER JOIN INVENTSUM s
ON i.??? = s.???
WHERE l.ITEMID = '#######'
答案 0 :(得分:2)
您需要InventDim
加入InventDimId
。
在X ++中,格式正确,它看起来像:
InventItemLocation InventItemLocation;
InventDim inventDim;
InventSum inventSum;
while select WMSPickingLocation from inventItemLocation
join TableId from inventDim
join PhysicalInvent from inventSum
where inventSum.InventDimId == inventSum.InventDimId &&
inventSum.ItemId == inventItemLocation.ItemId
{
}
这样可行,但不会为您提供您所声称的内容:每个位置都在手边。这就像:
InventDim inventDim;
InventSum inventSum;
while select InventLocationId from inventDim
group InventLocationId
join sum(PhysicalInvent) from inventSum
group ItemId
where inventSum.InventDimId == inventSum.InventDimId
{
}
在翻译为SQL时,请记住加入DataAreaId
和PartitionId
。