# Relational Algebra obtaining a list of duplicates

I've tried researching, and my best strategy I've got is to attempt to pull out data from the table, and then push the data against itself in order to remove all duplicates, ending up with a table of non-duplicates, which I can then 'minus set' over the original table, leaving me with duplicates.

OPERATION (ID, PID, DID, Date, Time, Type)

Is there anybody who is able to help me obtain a list of entries where there is more than 1 entry of a matching PID? I'm having issues working out exactly how to do what I've thought of, as well as, with relational algebra, is that the correct way?

• I'm having a hard time figuring out what you're trying to do. But if you're asking how to implement something in relational algebra, that sounds a lot like a programming question, and those are off-topic, here. – David Richerby Nov 15 '16 at 16:17
• Are you looking at a solution in SQL? – Yuval Filmus Dec 6 '16 at 7:49