my $sth = $dbh->prepare(' select * from album,song limit 2 '); $sth->execute(); print Dumper $sth->fetchrow_hashref(); print Dumper $sth->fetchrow_arrayref(); __END__ $VAR1 = { 'album_id' => '1', 'title' => 'Until the End of the World', 'artist_id' => '1', 'year' => '1991', 'id' => '1' }; $VAR1 = [ '2', 'War', '1983', '1', '1', 'Until the End of the World', '1' ]; #### my @fields = map { $_->[0] } @{$dbh->selectall_arrayref('desc song')}; my $sth = $dbh->prepare(" select @{[join(',',@fields)]} from song "); $sth->execute();