You can filter with a subquery:
select t.*from mytable twhere t.id = 101 t.completiondate = ( select max(t1.completiondate) from mytable t1 where t1.id = t.id and t1.id = t.id and t1.column1 = t.column1 )
Alternatively, in MySQL 8.0, you can use window function rank()
:
select *from ( select t.*, rank() over(partition by id, column1 order by completiondate desc) rn from mytable t where id = 101) twhere rn = 1
Note that, for this dataset, you could also use simple aggregation:
select id, column1, max(completiondate) completiondatefrom mytablewhere id = 101group by id, column1