1

我在 Android 上使用 SQLite,运行此命令时遇到问题:

UPDATE vocab_words SET correct = 5 
WHERE
    name = 'AQA GCSE Spanish Higher',
    foreign_word = 'campo, el',
    english_meaning = 'field, the'

这里有什么问题?提前致谢。

4

3 回答 3

5

您的 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 的基础知识。这是基本错误之一。

于 2013-03-10T18:10:06.103 回答
3

使用ANDnot 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'

于 2013-03-10T18:09:57.253 回答
0

从最初查看您的帖子开始,更新声明应该是 -

UPDATE vocab_words SET correct = 5 WHERE name = 'AQA GCSE Spanish Higher' and foreign_word = 'campo, el' and english_meaning = 'field, the'
于 2013-03-10T18:26:04.517 回答