Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Variance in sort order (collation)

by tangent (Priest)
on Feb 21, 2012 at 02:34 UTC ( #955216=note: print w/replies, xml ) Need Help??


in reply to Variance in sort order (collation) {Solved: needed sharper eyes}

There does seem to be a problem in multiple keys sort:
$last[$a] cmp $last[$b] or $first[$a] cmp $last[$b]
should be:
my @index = sort { $last[$a] cmp $last[$b] or $first[$a] cmp $first[$b] } 0 .. $#first; sort on multiple keys Adler, Rich Jackson, Jon Jones, Fred Jones, John Smith, Joe Smith, John But, testing, single sort (cmp): Fred Joe John John Jon Rich

Replies are listed 'Best First'.
Re^2: Variance in sort order (collation)
by ww (Bishop) on Feb 21, 2012 at 02:43 UTC
    Bingo! Thank you, tangent!

    and apologies to all the little electrons I inconvenienced by my bleary-eyes ...to say nothing of the Reverend Monks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://955216]
help
Chatterbox?
LanX is Discipulus reciting "Springtime for Hitler" ?
[choroba]: erix could tell you how to do it in Postgres
[LanX]: NOOOOOOOOOOOOOOO not again
[chacham]: wow, mysql really is as bad as i thougt
[choroba]: completion?
[LanX]: That's what he usually does when MySQL is mentioned ;-)
[chacham]: the same thing could be achieved with a trigger
[LanX]: choroba yes
chacham shudders at the thought of using a trigger...so evil
LanX will need to find a Perl workaround ... :-|

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-03-30 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (360 votes). Check out past polls.