[GENERAL] Sorting rows by a column and storing a row number

2010-10-31 Thread Alexander Farber
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,

Re: [GENERAL] Sorting rows by a column and storing a row number

2010-10-31 Thread Darren Duncan
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