如果使用Sqlite作为本地数据库,创建表的时候,表里的字段使用了Sqlite的保留字段。这个时候直接使用Sql语句进行操作数据库表的时候,就会报错,错误截图如下所示:
https://www.sqlite.org/lang_keywords.html
使用了保留字段+使用了直接使用Sql语句操作数据库
https://cloud.tencent.com/developer/ask/49047
'keyword' A keyword in single quotes is a string literal.
"keyword" A keyword in double-quotes is an identifier.
[keyword] A keyword enclosed in square brackets is an identifier. This is not standard SQL. This quoting mechanism is used by MS Access and SQL Server and is included in SQLite for compatibility.
`keyword` A keyword enclosed in grave accents (ASCII code 96) is an identifier. This is not standard SQL. This quoting mechanism is used by MySQL and is included in SQLite for compatibility.
之后涉及数据库表的时候,尽量避免使用关键字,这样可以避免好多不必要的麻烦。(例如,给表名或字段名前后添加个性化的前后缀)