我想选择最新的(order by id desc
)唯一对date_start, date_finish
CREATE TABLE some (
id SERIAL,
date_start TIMESTAMP,
date_finish TIMESTAMP
);
答案 0 :(得分:1)
怎么样:
select date_start, date_finish
from some
group by date_start, date_finish
order by max(id) desc