Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
sqlite:multiplewhere子句语法:where s=";somestring";其中i=0;_Sql_Sqlite_Android Sqlite - Fatal编程技术网

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个帖子中的最后一个。