我收到了客户列表[{'id': 31L}, {'id': 35L}]
,并在select查询中如何将id作为参数传递?
查询
for customer in customer_list:
"select * from base_order where location_id=%s and city='Hyderabad'", (customer['id'])
但它给出了错误 TypeError:无法连接'str'和'tuple'对象
答案 0 :(得分:0)
您是否尝试在ID周围加上引号以使每个字符串成为字符串?即。 ' 31L'