Postgres 8.4では...(番号順は、並べ替える列の単なるエイリアスです)
select id,hash, max(id) over (partition by hash) h
from my_table order by 3 desc,1 desc;
または
select id,hash
from my_table order by max(id) over (partition by hash) desc,
id desc
Postgres 8.4では...(番号順は、並べ替える列の単なるエイリアスです)
select id,hash, max(id) over (partition by hash) h
from my_table order by 3 desc,1 desc;
または
select id,hash
from my_table order by max(id) over (partition by hash) desc,
id desc