There are plenty of similar questions to be found on here but I don\'t think that any answer the question adequately.
I\'ll continue from the current most popular qu
Just use the max function and group function
select max(taskhistory.id) as id from taskhistory group by taskhistory.taskid order by taskhistory.datum desc