Ok, maybe to many hours the last couple of days but I am unable to fix this issue.
I have this table:
With this query I am trying to find all status
of each artikel_inh_id
with the latest date
SELECT
MAX(stat.datum) AS date,
stat.artikel_inh_id AS artikel_inh_id,
stat.status AS status
FROM verh_artikel_ihn AS art
LEFT JOIN verh_artikel_status AS stat
ON stat.artikel_inh_id = art.id
WHERE art.artikel_id = ".$row_table_2['id']."
GROUP BY stat.artikel_inh_id
For some reason all results are giving status = Beheerder
although the lasted date
is shown. Any suggestions?