i'm importing an excel file into sql server with line item information in it. I need to check if we have enough inventory to fulfill the orders. How can I write a query that will update canProcess = False
for each sku that does not have enough inventory?
Create Table OrderInfo
(
sku varchar(100)
,qtyOrdered int
,canProcess bit
)
Create Table AvailableQty
(
sku varchar(100)
,qtyAvaliable int
)
Insert Into OrderInfo (sku, qtyordered) Values
('abc-123', 10),('abc-123', 50),('abc-123', 100), ('def-123', 1000), ('def-123', 100),
('def-123', 100)
Insert Into AvaliableQty Values
('abc-123', 50), ('def-123', 10000)