Make ORDER BY into key plus value for Database::select call, per bug 9608