How can I update multiple columns on multiple rows in postgresql using psycopg2
问题 I have a somewhat complex sql query that should update multiple columns on multiple rows in a table. Am trying to pass the multiple parameters to the query and also loop though the data to be updated through psycopg2 but I can't figure out a way to do this. Here is the sample data I want to loop through. data = [(214, 'Feb', 545), (215, 'March', 466)] So far here is the sql query I have query = """ UPDATE table_1 SET date_from = (CASE version WHEN 1 THEN '1900-01-01' ELSE ( SELECT date_to