I have an external system that needs to update a record in my org. This system only knows the external id, but the problem is that this external id is not unique, e.g. multiple records might have the external id. Now I am changing the record id to be unique, and I want to query the all records created with a duplicate record id.
How can I perform this query?