我想运行一个更新,其中WHERE语句由2个SELECTS组成,这完全接近你的方式吗?
UPDATE Requests SET Response=1 WHERE
sender=SELECT userID FROM Users WHERE Username=?) and
Reciever = SELECT userID FROM Users WHERE Username=?
感谢!
答案 0 :(得分:1)
你错过了括号,就是这样。
UPDATE Requests SET Response=1 WHERE
sender = (SELECT userID FROM Users WHERE Username=?) and
receiver = (SELECT userID FROM Users WHERE Username=?);