I have a problem realizing one special kind of query:
I have two Models:
Jobs and JobStatus
Every Job has multiple JobStatus.
Every JobStatus has a name and a date.
I now need in my Job Model a field with the name of the JobStatus with the highest date.
Is that easily possible in ATK4?
I have the query written in SQL:
SELECT Name FROM (SELECT JID, MAX(date) AS created_at FROM JobStatus where JID='00b3f29e-8038-432e-ae58-30b755a58482' GROUP BY JID ) AS latest_orders INNER JOIN JobStatus ON JobStatus.JID = latest_orders.JID AND JobStatus.date = latest_orders.created_at