I need to confront a table with an array, both have 10 records, they have a date and a unique code, I need to know how many of these ten exist, so that I can replace the oldest