import MySQLdb
db = MySQLdb.connect(host='',user='',passwd='',db='',charset='utf8')
cursor = db.cursor(cursorclass=MySQLdb.cursors.DictCursor) #取出字典类型
while 1:
cursor.execute('select * from vi_fnreceivewithno where AuditTime between "%s" and "%s" limit %s,50000'%(st,et,num)) #分组查询
num += 50000
value = cursor.fetchall()
if len(value) < 50000:
run(value,date,h,num,re=1)
print 'finish all'
break