0
我在查询中发送一个电子邮件列表,但我得到一个错误,说它不能处理更多然后2100,我肯定有更多的可能是那个数量的三倍。我该如何分批处理这批配料的处理?SQL - 创建一个批处理 - SQL LIMIT为2100
sql = """with x as (\
select \
job_id, \
avg_runtime, \
j.id, \
row_number() over (partition by ja.job_id order by ja.id desc) rn \
from job_activity as ja \
join job as j on ja.job_id = j.id \
where \
j.name in ({0}) and \
ja.avg_runtime <> 0 and \
ja.avg_runtime is not null) \
select \
job_id, \
avg_runtime, \
id \
from x where rn = 1 ";"""
params = ",".join(map(lambda x: "?", flagged_job_names))
dataSet = data.Engine.execute(sql.format(params), flagged_job_names)
dataSet.fetchall()
那么......你连接到哪个SQL RDBMS? – 2014-09-30 16:11:25
MS SQL 11与pyodbc – user3590149 2014-09-30 16:31:10