In my table I have the following columns:
id|name|gender
I would like to extract all the names which are duplicated, but I don\'t want to scan
Is this what you're looking for?
select name from tbl group by name having count(*) > 1