declare @UpMasterID varchar(50)
declare @ItemMasterID varchar(50)
set @ItemMasterID='a4a3b6b4-6a27-4174-ae2e-f38d719336da'
set @UpMasterID = @ItemMasterID
declare @hasUp int
set @hasUp = 0
while(@hasUp =0)
set @ItemMasterID = (select b.ItemMasterID
from CAPP_BaseInfo b where b.ID in (select c.BaseID from CAPP_BomLine c
where c.ItemMasterID=@UpMasterID))
set @hasUp = @@rowcount
if @hasUp != 0
begin
set @UpMasterID = @ItemMasterID
end
select @UpMasterID
现在出现的问题,是只找了一层,请教高手问题出在什么地方