hi

using a postgres db i have run into a sort order problem because i need to 
order by a varchar type field/column. 
im not aware of any function in postgres that might order the result 
set "correctly" beforehand so i guess i want to post-sort the result-set with 
perl.
i'm looking for something pretty effecient as the datastructure could be 
potentially big


[

so in the end i need this order:

1
2
3
9
10
11
11a
11b
110

]



i have got the following sql syntax and datastructure

        
# sql, and data structure
$sth = $dbh->prepare( "SELECT id, name, team_no from DB order by team_no" ); # 
etc.

$sth->execute();
$sth->bind_columns( undef, \$id, \$name, \$team_no);

while ( $sth->fetch ) {
    $tied_hash{$team_no} = [$id, $name];
}



...

using tied_hash would currently sort something like this:

1
10
11
110
11a
11b
2
3
9


any suggestions most welcome
thanks
./allan

Reply via email to