Write a query to delete duplicate records in SQL SERVER
Answer Posted / prem
Hi All,
I want to display all duplicate records in the table. My
query has to fetch all the records which are duplicate(First
Name or Last Name). Also I want the ability to also pull
names where there might be a middle initial placed in the
end of the first name field, (i.e., "Maria Z. " vs. "Maria")
as well.
Please guide me to find this.
Table:
ID FirstName LastName
1 Zach H Hoffman
2 Zach Hoffman
3 Troy Hoffman
4 Shawn Livermore
5 Prem S
6 Jony Hoffman H
7 Zach Modan
I need the query to filter.........
ID FirstName LastName
1 Zach H Hoffman
2 Zach Hoffman
3 Troy Hoffman
6 Jony Hoffman H
7 Zach Modan
I hope this example will give you clear idea.....
Thanks in Advance
Prem
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are joins in sql and what are the different types of joins?
What is the index requirement in SQL Azure?
What does <> symbol mean?
Explain about builtinadministrator?
What protocol does sql server use?
What is difference between rollback immediate and with no_wait during alter database?
How many types of triggers in sql server?
how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?
What is a result set object returned by odbc_exec()?
Describe the functionalities that views support.
Define candidate key, alternate key, and composite key.
Is mysql better than sql server?
What are the types of subscriptions in SQL Server replication?
What are statistics?
How much space does sql server 2016 take?