Query to remove duplicate rows in sql server