我有一个名为“ critical_severity_list
”的列表,如下所示:[30, 40]
我想执行一个带有 IN 子句的选择,如下所示:
cursor = connection.cursor()
que = 'select * from tm_txn_age_severity_config where txn_state_id = %s and txn_type_id = %s and txn_age_severity_id in ( %s)'
in_ids = ', '.join(map(lambda x: '%s', critical_severity_list))
que = que % ('%s', in_ids)
bind_var_list = []
bind_var_list.append(rec[1])
bind_var_list.append(rec[2])
bind_var_list.extend(critical_severity_list)
cursor.execute(que, bind_var_list)
result = cursor.fetchall()
我收到此错误:格式字符串的参数不足
有人可以帮我解决....??