Sei caduto preda delle regole lassiste di MySQL che consentono di includere i non aggregati in una query GROUP BY. Certo, stai lavorando con MIN o MAX e solo UNO alla volta, ma considera questa query:
SELECT
CONCAT(work_type, work_id) AS condition_id,
status,
MIN(created_timestamp) as earliest,
MAX(created_timestamp) as latest
FROM conditions
GROUP BY condition_id
Ora pensa a quale riga la colonna di stato dovrebbe provenire da. È assurdo mettere una correlazione tra le colonne aggregate (quelle in GROUP BY) e non aggregate.
Invece, scrivi la tua domanda in questo modo
SELECT X.condition_id, C.status, X.earliest
FROM (
SELECT
CONCAT(work_type, work_id) AS condition_id,
status,
MIN(created_timestamp) as earliest
FROM conditions
GROUP BY condition_id
) X JOIN conditions C
on CONCAT(c.work_type, c.work_id) = X.condition_id
and c.created_timestamp = X.earliest
Ma se avevi due record con lo stesso create_timestamp, diventa ancora più complicato
SELECT X.condition_id, Max(C.status) status, X.earliest
FROM (
SELECT
CONCAT(work_type, work_id) AS condition_id,
status,
MIN(created_timestamp) as earliest
FROM conditions
GROUP BY condition_id
) X JOIN conditions C
on CONCAT(c.work_type, c.work_id) = X.condition_id
and c.created_timestamp = X.earliest
GROUP BY X.condition_id, X.earliest