And to correct myself one last time: * A. Pagaltzis <[EMAIL PROTECTED]> [2006-05-03 00:30]: > Assuming your client names are unique, this should work: > > SELECT > ( > SELECT > COUNT(*) > FROM clients c2 > WHERE c2.name < c1.name > ORDER BY c2.name ^^^^^^^^^^^^^^^^ this clause is superfluous > ) rank, > c1.name > FROM clients c1 > ORDER BY rank; > > On MySQL5 and PostgreSQL, it works as intended. Unfortunately, > SQLite complains that it doesn’t know about `c1.name`. I tried > to do it with a join to see if that would work better, but I’m > too frazzled to figure it out right now.
Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>