-1

Below query is duplicate checking based on FirstName, LastName, PhoneNo it not working for me because State column I didn't include in the grouping. So I want to include in return result in these fields also (Emp_Id, PostCode, and State) along with this result, duplicate checking only 3 this column (FirstName, LastName, PhoneNo). Can you help me?

select Distinct FirstName, LastName,PhoneNo from TestEmployee;

enter image description here

Sajith
  • 856
  • 4
  • 19
  • 48

1 Answers1

1

Expecting this?

 SELECT DISTINCT MIN(emp_id) AS emp_id, FirstName, LastName, max(postcode) AS postcode, [State],PhoneNo FROM Employees
 GROUP BY FirstName, LastName,[State],PhoneNo
lije
  • 420
  • 2
  • 15