【概要】pythonによるsql処理のプログラムの改良
【目的】すでにあるプログラムの解釈と改良をサポートして欲しい
【依頼背景】10行程度のpythonによるsql処理のプログラムがあり、処理内容を少し変えたいが、pythonとphpの知識不足のため、解釈と改良のサポートをお願いしたい。
具体的に下記プログラム
yahoo_sel_sql = "SELECT id FROM sell_on_yahoo_ifs WHERE status = 'new' and sale_id is not null and sale_id != '' and priority >= 20 group by sale_id having count(id) > 1 "
if cur.execute(yahoo_sel_sql) > 0:
yahoo_results = cur.fetchall()
for yahoo_result in yahoo_results:
yahoo_upd_sql = "UPDATE sell_on_yahoo_ifs set status = 'done' WHERE id = " + str(yahoo_result[0])
cur.execute(yahoo_upd_sql)
con.commit()