$sth = $dbh->prepare(" SELECT * FROM dat1 ORDER BY id LIMIT 15 " ); $sth->execute(); $dat = $sth->fetchall_arrayref(); $sth->finish(); foreach (@$dat) { @zeile = @{$dat->[$i++]}; print " Zeile: $i : @zeile \n"; } #nur letzte Zeile einfügen $sql = qq{ INSERT INTO dat2  VALUES @zeile }; $sth = $dbh->do($sql);