FAQ
"Matthew" == Matthew Terenzio writes:
Matthew> On May 3, 2005, at 8:30 PM, Randal L. Schwartz wrote:
Is there a simple way with PostgreSQL to assign relative ranks to the
result of a query ORDER BY?

Matthew> What do you mean by ranks?

If I order a query by ascending age, the youngest person gets
rank 1, the second youngest gets rank 2, the third youngest gets rank 3,
and if the fourth and fifth tie, they both get 4, and the next one gets 6.

You know, rank? :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 11 | next ›
Discussion Overview
grouppgsql-general @
categoriespostgresql
postedMay 4, '05 at 12:30a
activeMay 4, '05 at 1:45p
posts11
users9
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase