I'm aggregating data and in a table and basically moving the data from one table to the next.
Currently, I'm selecting all the data from MySQL and then inserting it back into the new table.
Is there a way to combine this query to do it all within MySQL rather than taking the data out and then back in?
Basically, I want to combine the following:
'''update landing_pages_v3 set mobile_first_place_rankings=%s where id=%s''', data
'''select count(keyword), lp_id from keywords_v3 where profile_id=%s and device=%s and positions=1 group by lp_id''', (profile_id, device)