私は2つのテーブルProduct
とProductInventory
. FULL Join を作成し、Makeflag
数量がゼロになったすべての製品を表示するクエリを作成しました。
Makeflag
数量が 0 になったすべての製品の値を 1 に変更できるように、出力を操作するにはどうすればよいですか?
以下のクエリはMakeflag
、数量がゼロになった製品だけでなく、実際にはすべての値に影響を与えています。
私は何を間違っているのですか...助けてください!
Use AdventureWorks2008R2
Select
Quantity, MakeFlag
from Production.ProductInventory
FULL Join AdventureWorks2008R2.Production.Product
ON ProductInventory.ProductID = Product.ProductID where Quantity = 0
update AdventureWorks2008R2.Production.Product set MakeFlag = 1