Hi Guys,
I want to remove duplicates from the table. The duplicate is a typo in the first and last name.
Here is the sample script
CREATE TABLE test_dup(
f_name nvarchar(20)
,l_name nvarchar(20)
,state nvarchar(20)
)
INSERT INTO dbo.test_dup
(
f_name,
l_name,
state
)
SELECT 'James','Smith','CA'
UNION all
select 'Smith','James','CA'
UNION all
select 'a','m','CA'
UNION all
select 'j','k','NY'
select * from dbo.test_dup
Here is the sample data
fname,lname,state
James,Smith,CA
Smith,James,CA
a,m,CA
j,k,NY
Here is what I want. (Only three unique records)
f_name,l_name,state
James,Smith,CA
a,m,CA
j,k,NY
Please let me know how can I accomplish this.
Thanks.