customer_id; status; date
1; 1; 01-01-2019
1; 3; 01-02-2019
2; 4; 01-02-2019
2; 3; 01-03-2019
customer_id; status; date
1; 3; 01-02-2019
2; 3; 01-03-2019
select distinct customer_id,
status,
max(date) as date_max
from *table*
group by customer_id
Hopefully you can help! Kind regards.
This query should do it:
select t.customer_id, t.status, t.date
from YourTable t
inner join (select customer_id, max(date) as date
from YourTable
group by customer_id) a
on (t.customer_id= a.customer_id and t.date = a.date)