in reply to Combine data in table

The solution is even easier than the other (good) suggestions in this thread. Use the new CREATE TABLE AS SELECT syntax to combine the three operations (remove a column, sum the columns, create a new table with the sums) into a single statement. This is a complete script that does exactly that, it creates a new CSV file called "partition_new.csv" with exactly the result set you specified:
#!/usr/bin/perl -w use strict; use DBI; my $dbh=DBI->connect("dbi:CSV(RaiseError=1):csv_eol=\n"); $dbh->{csv_tables}->{partition}->{file}='partition.csv'; $dbh->{csv_tables}->{partition_new}->{file}='partition_new.csv'; $dbh->do("DROP TABLE IF EXISTS partition_new"); $dbh->do(" CREATE TABLE partition_new AS SELECT colIP , SUM(colPartitionSize) AS colPartitionSize , SUM(colPartitionFree) AS colPartitionFree FROM partition GROUP BY colIP "); print `cat partition_new.csv`;