pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Muhyiddin A.M Hayat <middink@indo.net.id>
To: pgsql-sql@postgresql.org
Subject: Rank
Date: Sun, 2 May 2004 02:22:37 +0800
Message-ID: <003e01c42fa9$5677b240$4f00a8c0@MIDDINKS> (raw)

 
Dear All,

I Have below table

 id | site_name | point
----+-----------+-------
  1 | Site A    |    40
  2 | Site B    |    90
  3 | Site D    |    22
  4 | Site X    |    98

 Would like to calc that Rank for each site, and look like



 id | site_name | point | rank
----+-----------+-------+------
  1 | Site A    |    40 |    3
  2 | Site B    |    90 |    2
  3 | Site D    |    22 |    4
  4 | Site X    |    98 |    1

What can I do to get result like that

view thread (7+ messages)  latest in thread

Message-ID: <003e01c42fa9$5677b240$4f00a8c0@MIDDINKS>
Permalink:  ../003e01c42fa9$5677b240$4f00a8c0@MIDDINKS/
Also on:    postgresql.org/message-id/003e01c42fa9$5677b240$4f00a8c0@MIDDINKS

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: middink@indo.net.id
  Subject: Re: Rank
  In-Reply-To: <003e01c42fa9$5677b240$4f00a8c0@MIDDINKS>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox