Use the Postgres window functions like rank(); this is what they're for.
http://www.postgresql.org/docs/8.4/interactive/queries-table-expressions.html#QUERIES-WINDOW
-- Darren Duncan
Alexander Farber wrote:
Hello,
I have a card game for each I'd like to introduce weekly tournaments.
I'm going
Hello,
I have a card game for each I'd like to introduce weekly tournaments.
I'm going to save the score (virtual money) won by each player into:
create table pref_money (
id varchar(32) references pref_users,
yw char(7) default to_char(current_timestamp, '