I want to select all rows that have a value that already exists in the table. I did not find a better solution than
select *
from provisioning_requests tt
where code in (select code
from provisioning_requests tt2
where tt2.id <> tt.id)
This seems a bit naive. Does anybody have a better solution?
OR