I have a table named property ,structured like this.
property_id | ListingKey | name
1 abkjhj-123 abc
2 abkjhj-123 abc1
3 abkjhj-124 abc4
I want duplicate records based on ListingKey. I write this query but not sure is this correct or not?
SELECT a.property_id
FROM property a
INNER JOIN property b ON a.property_id = b.property_id
WHERE a.ListingKey <> b.ListingKey
Thanks in advance.