我试图将多个参数传递给sql查询,但它给我带来了错误
以下是查询
cbd_id=[1,10,19,31,37,42,48,57,63,64,65]
cursor.execute('''select t1.id as pid,pxval,pyval from <tbl1> t1 left join (select * from <tbl2> where clubid=? t2 on t1.id=t2.projectid where t1.cityid in (SELECT cityid FROM <tbl3> WHERE cbdid =? group by cityid) and t1.pxval>0 and t2.distance is null order by projectid)''',(cbd_id[i],cbd_id[i]))
它给了我错误
^{pr2}$但我查了一下没发现问题
任何关于这方面的建议都会有帮助。在
谢谢
如错误消息所示,您的SQL命令文本格式不正确。为了清晰起见,您的查询是
请注意,
^{pr2}$<tbl2>
子查询没有右括号。你的疑问应该是相关问题 更多 >
编程相关推荐