Given a table
id date job color qty
1 2018-12-10 12345 green 1
2 2018-12-11 12345
3 2018-12-15 12345
4 2018-12-21 12345 red
5 2018-12-21 12345 4
6 2018-12-22 12345
The id column is auto incrementing and is the tables primary key.
A simple query
SELECT * FROM `table` WHERE `job` = '12345' ORDER BY `id` ASC;
Would return all records for the job 12345 in the order they were inserted.
Question: How would I query the table to only return a single row with the most recent values from each column?
The desired row would look like this
6 2018-12-22 12345 red 4
