2010-02-24 Postgresで簡単にランキング処理 8.4からWindow関数というものが追加されたらしい。 http://lets.postgresql.jp/documents/technical/window_functions/