标签:mysqldb sql 更新 rom and where ring mat arguments
‘UPDATE table_a SET impression=%s,click=%s,ctr=%s,cost=%s,update_time=%s WHERE date=%s AND campaign_id=%s‘
‘INSERT INTO table_a(date,campaign_name,campaign_id,impression,click,ctr,cost,advertiser_id,add_time,update_time) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)‘
‘SELECT EXISTS(SELECT * FROM table_a WHERE date="{}" and campaign_id={})‘.format(format_date, str(campaign_id))‘
注意:SQL语句中所有的占位符都要用%s,不然会报错“MySQLdb TypeError: not all arguments converted during string formatting”
标签:mysqldb sql 更新 rom and where ring mat arguments
原文地址:https://www.cnblogs.com/lanlingshao/p/9771711.html