sqlite:多个where子句语法:where s="somestring" and where i=0;
sqlite: multiple where clause syntax: where s="somestring" and where i=0;
我犯了什么错误?
$ 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 i=0;
而不是
select *
from t
where s="somestring"
and where i=0;
select * from t where s="somestring" and i=0;
删除最后一个 where
- 每个语句只需要而且只能有一个 where
。
您不需要在此查询中指定 where 2 次
sqlite> select * from t where s="somestring" and i=0;
应该够了。
我犯了什么错误?
$ 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 i=0;
而不是
select *
from t
where s="somestring"
and where i=0;
select * from t where s="somestring" and i=0;
删除最后一个 where
- 每个语句只需要而且只能有一个 where
。
您不需要在此查询中指定 where 2 次
sqlite> select * from t where s="somestring" and i=0;
应该够了。