這個更新語句,能不能在 where條件用上雙條件
比如:
UPDATE Result SET A = A+1 WHERE (Result.SNo,Result.CNo) = all(select TempInfo.SNo,TempInfo.CNo from Student,TempInfo where Student.SNo=TempInfo.SNo and Student.BtAddress=TempInfo.BtAddress )
可是這樣報錯。
一般的更新語句都是單條件,能不能改成復合的條件!
如果是單條件能成功,就是這樣:
UPDATE Result SET A = A+1 WHERE (Result.SNo) = any(select TempInfo.SNo from Student,TempInfo where Student.SNo=TempInfo.SNo and Student.BtAddress=TempInfo.BtAddress )
但是我現在需要符合符合where後兩個條件
這個要怎麼改才能成功!
多謝各位了!
UPDATE Result SET A = A+1 WHERE (Result.SNo) = any(select TempInfo.SNo from Student,TempInfo where Student.SNo=TempInfo.SNo and Student.BtAddress=TempInfo.BtAddress )
and Result.CNo = any(select TempInfo.SNo from Student,TempInfo where Student.SNo=TempInfo.SNo and Student.BtAddress=TempInfo.BtAddress )
你是想這樣?