我在 Android 上使用 SQLite,运行此命令时遇到问题:
UPDATE vocab_words SET correct = 5
WHERE
name = 'AQA GCSE Spanish Higher',
foreign_word = 'campo, el',
english_meaning = 'field, the'
这里有什么问题?提前致谢。
您的 SQL 查询有语法错误。请从以下位置更改您的查询:
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher', foreign_word = 'campo, el', english_meaning = 'field, the'
到:
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher'AND foreign_word = 'campo, el'AND english_meaning = 'field, the'
此外,我建议您使用一些教程阅读 SQL 的基础知识。这是基本错误之一。
使用AND
not with组合两个或多个简单条件comma(,)
。
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher', foreign_word = 'campo, el', english_meaning = 'field, the'
用。。。来代替
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher' AND foreign_word = 'campo, el' AND english_meaning = 'field, the'
从最初查看您的帖子开始,更新声明应该是 -
UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher' and foreign_word = 'campo, el' and english_meaning = 'field, the'