【发布时间】:2017-03-15 17:54:00
【问题描述】:
我的代码有以下部分
cursor.execute("select titre from article WHERE titre LIKE '%s%%' OR paragraphe LIKE '%s%%' " % (cherche, cherche) )
如果参数 (cherche) 的值在句子的开头,结果是正确的问题,但我希望所有结果都包含 paranee 和 titre 包含单词 (cherche)。
【问题讨论】:
-
你还没有真正提供足够的信息,但我要试一试:
cursor.execute("select titre from article WHERE titre LIKE '%%%s%%' OR paragraphe LIKE '%%%s%%' " % (cherche, cherche) )
标签: python sql python-2.7 sqlite