google sheets – Remove duplicate data

I have built quite a basic CRM system, each client has a sheet, on that sheet there’s a form that populates information on rows related to whats been inputted. the idea is to standardise information from a generic google sheet.

I have a master sheet that has, in A1 =QUERY({‘client number one.’!A24:O;clienttwo!A25:O;’client number three’!A25:O},”select * where Col1 is not Null”,1)etc..

Which works well, it populates the information from the other sheets in one place. Sometimes i need to duplicate a row and change one cell/ column of data.

The problem I face is that i need the most recent row to be visible, and to be able to remove the duplicate row so that my overview doesn’t “double count” but I also need the historical data for pricing etc.

On a sheet with a Query populating the information, how I can i remove duplicate rows in a semi/ fully automated way?