[sql] sql query to find the duplicate records