http://www.perlmonks.org?node_id=11106494


in reply to Re: DBI: select distinct returns same values
in thread DBI: select distinct returns same values

This is correct: your results-array contains three references to the same result record. That is why you see three copies of the last row. (The SQL query is presented as literal text and you have already showed us what the result is.) You must make a deep copy of each row that is returned ... or, simply skip the step of putting them into a separate array entirely and work directly from the first loop.
  • Comment on Re^2: DBI: select distinct returns same values

Replies are listed 'Best First'.
Re^3: DBI: select distinct returns same values
by tukusejssirs (Beadle) on Sep 21, 2019 at 15:37 UTC

    AnomalousMonk: Sorry I have done againt the site rules. Iíll mend my ways, I promiss! :)

    Anonymous Monk: You are right about the push(@all_rows, [@$ref]). It really fixed the output. Thanks!