my %records; while( my $row = $sth->fetchrow_hashref ) { push @{ $records{ $row->{start_date} } }, $row; }