I have an Oracle query
select max(m.id),
m.someId keep (DENSE_RANK FIRST ORDER BY m.UpdateDate desc)
from MyTable m
groupBy m.someId
In case someone look for Oracle KEEP DENSE_RANK simulation in Postgres:
CREATE TABLE myt (
"id" INTEGER,
"update_date" timestamp,
"some_id" INTEGER
);
INSERT INTO myt
("id", "update_date", "some_id")
VALUES
('1', '2012-01-20', '10'),
('2', '2012-01-20', '10'),
('3', '2012-01-01', '10'),
('4', '2012-10-02', '20'),
('5', '2012-01-02', '20'),
('6', '2012-01-04', '30');
select
some_id,
(array_agg(id order by update_date desc, id desc))[1]
from myt
group by some_id
order by some_id