python execute 语句中 有变量 怎么写

推荐方式一:cur.execute(“select count(*) from table_name where aaa=:1 and bbb=:2″,(1234,’test’))推荐方式二:cur.execute(“select count(*) from table_name where aaa=:x and bbb=:y”,x=1234,y=’test’)
python execute 语句中 有变量 怎么写
推荐方式一:

cur.execute(“select count(*) from table_name where aaa=:1 and bbb=:2″,(1234,’test’))

推荐方式二:

cur.execute(“select count(*) from table_name where aaa=:x and bbb=:y”,x=1234,y=’test’)2014-07-01
mengvlog 阅读 5 次 更新于 2025-07-19 07:34:29 我来答关注问题0
檬味博客在线解答立即免费咨询

Python相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部