while select * from _iTab { while select InventDimId from _iDim where _iDim.InventLocationId=='Склад' && _iDim.InventDimId in (select InventDimId from _iSum where _iTab.Itemid==_iSum.ItemId) {