I have a table in SQL server with 2.5 M records and I want to select the unique records as in image below. Can someone help me write a select query for this?
Original table and requested data:
Advertisement
Answer
SELECT NAME,CODE,COUNTRY,COUNTRY_CODE,COUNT(1) AS [COUNT] FROM SourceTable GROUP BY NAME,CODE,COUNTRY,COUNTRY_CODE