:
SELECT id, max(date), MAX(time) , tran
FROM table
GROUP BY id
MAX (tran) GROUP BY tran , .
Otherwise, you will obviously end up with tran = 1234, since your query retrieves only those rows where the date is MAX (date) and the time is MAX (time), but the tran value is the normal tran value. In addition, you execute the GROUP BY identifier, while for GROUP BY there must be a maximum tran value.
So, your request should be changed to something like this:
SELECT MAX(date), MAX(time), MAX(tran)
FROM table
GROUP BY tran
source
share