in reply to DBI: select distinct returns same values
You might try replacing push( @all_rows, $ref ); with push( @all_rows, [ @$ref ] );.
The DBI docs for fetchrow_arrayref() say "Note that the same array reference is returned for each fetch, so don't store the reference and then use it after a later fetch.".
The [ @$ref ] effectively does a shallow clone of $ref, so you should get distinct values again. Of course, if it were me I would push $ref->[0], and then in the following foreach loop just print "$row_ref\n";.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBI: select distinct returns same values
by Anonymous Monk on Sep 21, 2019 at 14:48 UTC | |
by tukusejssirs (Beadle) on Sep 21, 2019 at 15:37 UTC |