In my table below, I have
job_id fields with some of the
job_id fields being duplicates.
I want to get the
MAXIMUM value of the
id field corresponding to each
I have now tried the
GROUP_BY clause, but it is not giving me the right result.
SELECT MAX(id) AS max_id, job_id FROM job_status_update GROUP BY job_id
But from the first image, the
id of 6 from the job_status_update table corresponds to
job_status_id of 3 and not 1
So I want to write a query to get just these fields:
Please can someone give me a pointer on what to do? Thank you!