in reply to Re: SQLite (DBD) Sorting
in thread SQLite (DBD) Sorting

Thank you for your reply. What I don't get is how you are going to limit the sorting to only one specific database column (in the example column1) when using your first solution:

foreach my $row_db ( sort { deaccent($a) cmp deaccent($b) } @$selected + ) { my ($ID, $column1, $column2) = @$row_db; print "$column1\n"; }

I implemented your approach, but I get a "no ordered" output, probably due to the missing reference to the column I want to sort.

I'd really hope to get your answer!

Replies are listed 'Best First'.
Re^3: SQLite (DBD) Sorting
by ikegami (Patriarch) on Apr 29, 2010 at 18:47 UTC
    sort { deaccent($a) cmp deaccent($b) } @$selected
    should be
    sort { deaccent($a->[1]) cmp deaccent($b->[1]) } @$selected
    and
    map $_->[0], sort $a->[1] cmp $b->[1], map [ $_, deaccent($_) ], @$selected
    should be
    map $_->[0], sort $a->[1] cmp $b->[1], map [ $_, deaccent($_->[1]) ], @$selected
Re^3: SQLite (DBD) Sorting
by thundergnat (Deacon) on Apr 29, 2010 at 18:48 UTC

    Ah. My bad. You need to access the correct column in the row array.

    foreach my $row_db ( sort { deaccent($a->[1]) cmp deaccent($b->[1]) } +@$selected ) { my ($ID, $column1, $column2) = @$row_db; print "$column1\n"; }

      It works perfectly! Thank you very much! Cla