G
goodbobi
Unregistered / Unconfirmed
GUEST, unregistred user!
-----------------------------------------------------------<br>採購主檔:<br>id<br>採購單號<br>採購日期<br>客戶編號<br>...<br><br>採購明細:<br>id<br>採購主檔id(用來關聯採購主檔id)<br>產品編號<br>品名<br>規格<br>數量<br>已進貨數量<br>...<br><br>採購關聯: SELECT * FROM 採購明細 LEFT JOIN 採購主檔 ON 採購明細.採購主檔id=採購主檔.id<br>----------------------------------------------------------<br>進貨主檔:<br>id<br>進退別(進/退)<br>進/退貨單號<br>進/退貨日期<br>...<br><br>進貨明細<br>進/退貨主檔id(用來關聯進/退貨主檔id)<br>採購單號<br>產品編號<br>品名<br>規格<br>數量<br><br>進貨關聯: SELECT * FROM 進貨明細 LEFT JOIN 進貨主檔 ON 進貨明細.進貨主檔id=進貨主檔.id<br>-----------------------------------------------------------<br><br>如何根據[進貨主檔[的[進/退別],及[進貨明細檔]的[採購單號]及[產品編號],更新[採購明細檔]的[已進貨數量]寫一觸發器(SQL Server)