#coding:utf-8
a = ‘‘‘update ph_daily t set t.{0} =
decode((to_number(to_char(sysdate-2,‘DD‘))*t.{1}),0,0,t.{2}/(to_number(to_char(sysdate-2,‘DD‘))*t.{1})); ‘‘‘
b = (‘N5S_M_TARGET‘,‘N5S_M‘,‘N5S_M_RATE‘,‘A750E_TARGET‘,‘A750E_M‘,‘A750E_M_RATE‘,‘C8815_TARGET‘,‘C8815_M‘,‘C8815_M_RATE‘,‘EG958_TARGET‘,‘EG958_M‘,‘EG958_M_RATE‘,‘COOLPAD5891_TARGET‘,‘COOLPAD5891_M‘,‘COOLPAD5891_M_RATE‘,‘N900_TARGET‘,‘N900_M‘,‘N900_M_RATE‘,‘I619_TARGET‘,‘I619_M‘,‘I619_M_RATE‘)
c = [b[m:m+3] for m in range(20) if m%3 == 0] #或者 c = zip(*(iter(b),)*3) 按3个一组分割
for x, y, z in c:
print a.format(z, x, y)