* Ed Pasma <[EMAIL PROTECTED]> [2007-05-07 10:28]: > This solution may is tricky but has occasoinaly helped me. It > is written here dedicated for the example data. For real data > the leftpadding should likely be increased to the content of > the sorting key. Also the result may need to be converted to > the expected data type, it has now become text. > > SELECT > g, > SUBSTR (MAX (SUBSTR (' ' || p, -2, 2) || v), 3, 1) v FROM > t > GROUP BY > g > ;
Heh, very cool. A Guttman-Rosler transform [1] in SQL. [1] http://www.sysarch.com/Perl/sort_paper.html Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------