I have a table of entries in a mysql table:
script lastRun processed
________________________________
scriptA 1663695633 0
scriptB 1663695647 1
scriptA 1663695776 0
scriptB 1663695799 1
scriptC 1663695950 1
scriptA 1663695957 0
scriptB 1663695959 1
I am trying to get 1 entry for each script that is the last date run.
the results from the above I am trying to get are:
scriptC 1663695950 1
scriptA 1663695957 0
scriptB 1663695959 1
I have tried using
select distinct script,lastRun,processed from table order by lastRun;
but i get all entries.
I have tried using
select script,lastRun,processed from table group by script order by lastRun asc;
but i dont get the latest run for each.
what query can i use to achieve my goal?