Hi anonymous user
Please refer to:
declare @table table(Item char(15),Warehouse char(15),Min_QTY_Allowed int,ReorderQTY int)
insert into @table values('ITEM1','Whs_I',NULL,NULL),('ITEM1','Whs_O',2750,4000),
('ITEM2','Whs_I',NULL,NULL),('ITEM2','Whs_O',100,400),
('ITEM3','Whs_I',10,200),('ITEM3','Whs_O',NULL,NULL)
select * from @table
update t1
set Min_QTY_Allowed = isnull(t2.Min_Qty_Allowed, t1.Min_Qty_Allowed),
ReorderQTY = isnull(t2.ReorderQTY, t1.ReorderQTY)
from @table t1
join @table t2
on t1.item = t2 .Item and t1.warehouse ='Whs_I' and t2.warehouse ='Whs_O'
select * from @table
If you have any question, please feel free to let me know.
If the response is helpful, please click "Accept Answer" and upvote it.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hot issues November--What can I do if my transaction log is full?
Hot issues November--How to convert Profiler trace into a SQL Server table