0
這兩個表都有一個client_id列。當client_id列相同時,需要將#LocalDashboardtable中的數據插入到T004_Dashboard中。我已經試過,但它簡化版,幫助顯示錯誤根據Id將行從一個表更新到另一個表
update T004_Dashboard set T004_Dashboard.[GrossCharge],T004_Dashboard.[NetCharge]
= (select #LocalDashboardtable.[GrossCharge] , #LocalDashboardtable.[NetCharge]
from #LocalDashboardtable where
#LocalDashboardtable.client_id =T004_Dashboard.client_id and
#LocalDashboardtable.[month] =T004_Dashboard.[month]
and #LocalDashboardtable.[year] =T004_Dashboard.[year] )
請幫我
您正在使用SQL Server的語法,但問題是標籤的MySQL合格的列名。你真的在使用哪個數據庫? – 2014-12-04 03:44:10
我正在使用SQL Server2008 R2 – 2014-12-04 03:49:45