sqlite:multiplewhere子句语法:where s=";somestring";其中i=0;
我犯了什么错误sqlite:multiplewhere子句语法:where s=";somestring";其中i=0;,sql,sqlite,android-sqlite,Sql,Sqlite,Android Sqlite,我犯了什么错误 $ sqlite3 test.db SQLite version 3.8.5 2014-08-15 22:37:57 Enter ".help" for usage hints. sqlite> create table t (s text not null, i integer); sqlite> select * from t where s="somestring"; /* works */; sqlite> select * from t where i
$ sqlite3 test.db
SQLite version 3.8.5 2014-08-15 22:37:57
Enter ".help" for usage hints.
sqlite> create table t (s text not null, i integer);
sqlite> select * from t where s="somestring"; /* works */;
sqlite> select * from t where i=0; /* works */;
sqlite> select * from t where s="somestring" and where i=0;
Error: near "where": syntax error
试一试
而不是
select *
from t
where s="somestring"
and where i=0;
试一试
而不是
select *
from t
where s="somestring"
and where i=0;
从t中选择*,其中s=“somestring”和i=0代码>
删除最后一个where
-每个语句只需要并且只能有一个where
。从t中选择*,其中s=“somestring”和i=0代码>
删除最后一个where
-每个语句只需要并且只能有一个where
。您不需要在该查询中指定两次where
sqlite> select * from t where s="somestring" and i=0;
应该足够了。您不需要在该查询中指定两次
sqlite> select * from t where s="somestring" and i=0;
应该足够了。你的答案对之前接受的答案有什么补充?我在那之前发布了这个答案,我想这个答案对接受的答案没有任何补充。那么我应该删除这个吗?@mustaccio接受的答案实际上是3个已发布答案中的最后一个。你的答案对以前接受的答案有什么补充?我在那之前发布了这个答案,我猜这个答案对已接受的答案没有任何补充。那么我应该删除这个吗?@mustaccio接受的答案实际上是3个帖子中的最后一个。