Anda dapat melakukan ini:
SELECT
ser.id,
ser.name,
s.status,
s.timestamp
FROM Service ser
INNER JOIN status as s ON s.service_id = ser.id
INNER JOIN
(
SELECT
service_id,
MAX(timestamp) AS MaxDate
FROM status
GROUP BY service_id
) AS a ON a.service_id = s.service_id
AND a.MaxDate = s.timestamp;
Gabung dengan subquery:
SELECT
service_id,
MAX(timestamp) AS MaxDate
FROM status
GROUP BY service_id
Akan menghilangkan semua status kecuali yang memiliki tanggal terbaru.