Check out example codes for "postgres select duplicate columns". It will help you in understanding the concepts better.

Code Example 1

select Column1, Column2, count(*)
from yourTable
group by Column1, Column2
HAVING count(*) > 1

Code Example 2

select * from yourTable ou
where (select count(*) from yourTable inr
where inr.sid = ou.sid) > 1

Learn ReactJs, React Native from akashmittal.com