Hi all,
Hope you all are doing good.
I have a table (a simplified version of what I have) like below.
My requirement is to select only the values that are duplicates considering with case-sensitivity. I mean strictly case-sensitive. I don't really care if the same values are present in two or more rows as long as they are one and the same with case-sensitivity. If they differ in case, only then I will expect them to be part of the result set.
with tab(names, some_column) as
(
select 'Sam', 'xyz' from dual union all
select 'SAM', 'abc' from dual union all
select 'SaM', 'ijk' from dual union all
select 'Sam', 'opq' from dual union all
select 'Ram', 'def' from dual union all
select 'Tom', 'pqr' from dual union all
select 'Tom', 'John' from dual
)
select * from tab;
Sample Output:

Explanation:
SAM and SaM are same as Sam but different only in terms of Case.
Ram does not have any such data so, does not come up in the result set
Tom and Tom are one and the same. And hence it too does not come up in the result