我有一張表,我需要根據另一個表中的信息進行更新。我寫了一個精選的查詢,它能夠很好地工作,並顯示我需要擺脫的內容,但是當我嘗試將其更改爲更新查詢時,我在Join中遇到錯誤。我希望有人能夠向我指出一個簡單的疏忽。在SQL Server 2005 express中使用連接
這裏是工作的選擇查詢:
select *
from CustPayShdul
JOIN ARcreditapply
ON ARcreditapply.AplyedRefNo = CustPayShdul.ReferNo AND ARcreditapply.AplyedLocation = CustPayShdul.LocationNo
AND ARcreditapply.sequence2 = CustPayShdul.Paysequence
where ARcreditapply.PaidDate < '1/1/2012' and ARcreditapply.PaidDate < CustPayShdul.InvDate
這裏是更新查詢,返回一個錯誤:
update custpayshdul
set custpayshdul.payablebalance = custpayshdul.amount
JOIN ARcreditapply
ON ARcreditapply.AplyedRefNo = CustPayShdul.ReferNo AND ARcreditapply.AplyedLocation = CustPayShdul.LocationNo
AND ARcreditapply.sequence2 = CustPayShdul.Paysequence
where ARcreditapply.PaidDate < '1/1/2012' and ARcreditapply.PaidDate < CustPayShdul.InvDate
**這些錯誤是什麼**?請給我們確切的完整的錯誤信息.... – 2012-02-08 20:33:41