create table s ( a varchar(255), o int ); # insert the string and its numeric sort order as set by perl's sort select a from s order by o;