python sqlite3无法在查询中使用条件(>,<,=)

时间:2018-05-04 19:30:16

标签: python

我遇到了一个奇怪的问题,

设置是:Python 3.6.5和sqlite3

我在DB中运行一个简单的查询,假设“c”是我的光标对象:

c.execute("select count from mydb where bytes is ?",(myvariable,))

这个工作绝对正常,但如果我要添加“>”它呢

c.execute("select count from mydb where bytes is > ?",(myvariable,))

我收到以下错误:

  

OperationalError:在“>”附近:语法错误

这在python 2.7中运行得非常好,

我很感激任何帮助。

此致

哈利

0 个答案:

没有答案
相关问题