All pastes #444312 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-17 09:47 UTC
rendered paste body
churn=# update test set rank = ( select count(*) from test x2 where x2.mark >= t
est.mark );
UPDATE 6
churn=# select * from test;
 mark | rank
------+------
   67 |    2
   56 |    4
   60 |    3
   70 |    1
   40 |    6
   40 |    6
(6 rows)

here the rank shd be 5 for both 40 but it displays as 6.