我一直在java中遇到这个错误。我确实看过类似的问题,但他们没有帮助。有人能解决吗?感谢
UPDATE SearchedWords
SET SearchedWords.NrOfSearches=SearchedWords.NrOfSearches+1
FROM SearchedWords
INNER JOIN Dictionary ON SearchedWords.WordID=Dictionary.ID
WHERE Dictionary.Word=? AND SearchedWords.UserID=?;
答案 0 :(得分:2)
SQLite不支持JOIN
中的UPDATE
。这是一个解决方法:
UPDATE SearchedWords
SET NrOfSearches = NrOfSearches + 1
WHERE EXISTS (SELECT 1
FROM Dictionary d
WHERE d.ID = SearchedWords.WordID AND
d.Word = ?
) AND
UserID = ?;