Проблему свою решил, но не очень хорошим способом:
Код:
SELECT E.Man_ID, E.Event_ID
FROM Events E,
(
SELECT E1.Man_ID, E1.Event_date, Max(E1.[Order]) AS Max_Order
FROM Events E1,
(
SELECT Events.Man_ID, Max(Events.Event_date) AS Max_Date
FROM Events
GROUP BY Events.Man_ID
) E2
WHERE E1.Man_ID = E2.Man_ID AND E1.Event_date = E2.Max_Date
GROUP BY E1.Man_ID, E1.Event_date
) E3
WHERE E.Man_ID = E3.Man_ID AND E.Event_date = E3.Event_date AND E.[Order] = E3.Max_Order
GROUP BY E.Man_ID, E.Event_date, E.[Order], E.Event_ID
ORDER BY E.Man_ID
Код:
SELECT E.Man_ID, E.Event_ID
FROM Events E,
(
SELECT E1.Man_ID, E1.Event_date, Max(E1.[Order]) AS Max_Order
FROM Events E1,
(
SELECT Events.Man_ID, Max(Events.Event_date) AS Max_Date
FROM Events
GROUP BY Events.Man_ID
) E2
WHERE E1.Man_ID = E2.Man_ID AND E1.Event_date = E2.Max_Date
GROUP BY E1.Man_ID, E1.Event_date
) E3
WHERE E.Man_ID = E3.Man_ID AND E.Event_date = E3.Event_date AND E.[Order] = E3.Max_Order
GROUP BY E.Man_ID, E.Event_date, E.[Order], E.Event_ID
ORDER BY E.Man_ID