Например есть таблица:
create table `test` (
`id` int not null auto_increment,
`dop_id` int not null,
`time` datetime not null
);
с записями
insert into `test` (`dop_id`, `time`) value (1,now());
insert into `test` (`dop_id`, `time`) value (1,now());
insert into `test` (`dop_id`, `time`) value (1,now());
insert into `test` (`dop_id`, `time`) value (2,now());
insert into `test` (`dop_id`, `time`) value (2,now());
insert into `test` (`dop_id`, `time`) value (2,now());
insert into `test` (`dop_id`, `time`) value (3,now());
insert into `test` (`dop_id`, `time`) value (3,now());
insert into `test` (`dop_id`, `time`) value (3,now());
нужно выбрать по одной последней записи c dop_id 1,2 и 3.