Good day!
There is such a table
id date date_over time user_id client_id 1 2017-11-22 2017-11-24 16:07:00 1 1 2 2017-11-22 2017-11-23 16:10:00 1 2 3 2017-11-24 2017-11-25 12:10:00 1 1 Help to create a query to remove duplicates by client_id, and the most difficult thing for me here is to remove the old entries, that is, to make such a table
id date date_over time user_id client_id 2 2017-11-22 2017-11-23 16:10:00 1 2 3 2017-11-24 2017-11-25 12:10:00 1 1 that is, get the most recent date_over for each client
group by client_idwill certainly help you, only with the other columns decide which values you want to get for them, minimum / maximum or something else smarter - Mike