Here is a problem I've encountered a few times lately:
Given
CREATE TABLE foo(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
some_id INT NOT NULL,
ts TIMESTAMP NOT NULL
);
find the last (ordered by ts) N id's for each some_id, with N > 1.
Is this possible in "pure" (i.e. without application code) MySQL 4.1.x?
--
felix