sqlite:multiple where子句语法:其中s =" somestring"并且其中i = 0;

时间:2016-02-14 19:08:59

标签: 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=0; /* works */;
sqlite> select * from t where s="somestring" and where i=0;
Error: near "where": syntax error

3 个答案:

答案 0 :(得分:2)

您无需在此查询中指定2次

<sites>

应该足够了。

答案 1 :(得分:1)

尝试

select * 
from t 
where s="somestring" 
and i=0;

而不是

select * 
from t 
where s="somestring" 
and where i=0;

答案 2 :(得分:1)

select * from t where s="somestring" and i=0;

删除最后一个where - 您只需要,并且每个语句只能有一个where