In article <427821D7(dot)7070302(at)sysmaster(dot)com>,
Lyubomir Petrov <lpetrov(at)sysmaster(dot)com> writes:
> create sequence seq_tmp;
> select nextval('seq_tmp') as rank, a.id, a.name from (select id, name
> from t order by name desc) a;
> drop sequence seq_tmp;
Using a temporary sequence for that would avoid naming conflicts.
> P.S. I'm sure you can wrap it in plperl stored procedure :)
Yes, prepending the ranking column in the application would be more efficient.
I wonder whether Randall knows Perl? ;-)