cur.execute('insert into keywords(keywords, count) values(%s,%s)', (key, from_url_dict[key]))
{key1:10,key2:100}
{key1:30,key3:100}
The front is key, and the corresponding back is count
How to make mysql insert data when there is a key phase At the same time, the corresponding count values are added?
迷茫2017-05-16 13:11:32
insert into keywords(keywords, count) values(%s,%s) ON DUPLICATE KEY UPDATE count = count +1;