【问题标题】:How to search an sql lite database with python and print out the result in my ide?如何使用 python 搜索 sqlite 数据库并在我的 ide 中打印结果?
【发布时间】:2022-01-14 14:52:07
【问题描述】:

我正在尝试开发一种方法,它允许用户按选定的字段和值进行搜索,例如。 SELECT * FROM table WHERE column_field = 'value'。

它在 SQL lite 中执行得很好,但是当我将它带入我的 IDE 时,什么都没有打印出来。非常感谢任何建议。

【问题讨论】:

    标签: sql python-3.x sqlite


    【解决方案1】:

    来自sqlite doc keywords page

    'keyword'单引号中的关键字是字符串字面量。

    建议不要在查询中引用{field}

    【讨论】:

    • 成功了,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-03
    • 1970-01-01
    • 1970-01-01
    • 2018-07-06
    • 1970-01-01
    • 2021-10-05
    • 1970-01-01
    相关资源
    最近更新 更多