我犯了什么错误?
$ 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
答案 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
。