删除匹配两个变量的SQLite3 DB中的特定记录

时间:2017-05-19 21:23:14

标签: python-3.x sqlite

我有一个写入SQLite3数据库的Python脚本,该表名为When checking argument func to function Prelude.Functor.map: Type mismatch between (l : List elem) -> Vect (length l) elem (Type of fromList) and a1 -> List (Vect size a) (Expected type) Specifically: Type mismatch between Vect (length v0) elem and List (Vect size a) ,它有两个文本内容列notify_userslanguage_code

可视化,然后,username数据库看起来像这样:

notify_users

我想要做的是能够使用两个标准(language_code和username)来删除特定记录。

例如,我想删除| language_code | username | --------------------------------- | de | jane_doe | | sv | jane_doe | | fi | jane_doe | | de | tom_petty | | zh | tom_petty | 列中 jane_doeusernamede的记录。

language_code

如何正确格式化| language_code | username | --------------------------------- | de | jane_doe | X | sv | jane_doe | | fi | jane_doe | | de | tom_petty | | zh | tom_petty | 查询以完成此任务?提前谢谢!

1 个答案:

答案 0 :(得分:0)

您可以使用and

将条件串在一起
conn.execute("""delete from notify_user 
                where language_code = ? and username = ?;""",('de','jane_doe'))