Update sql_write_csv_all_avg