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
How data can be copied from one table to another table?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
What is the difference between join and inner join?
What is public role in sql server?
What happens if null values are involved in bitwise operations?
List some case manipulation functions in sql?
What is fill factor and pad index?
How to find out the list schema name and table name for the database?
mention different types of relationships in the dbms?
How to create new databases with "create database" statements?
What factors you will consider calculating the storage requirement for that view?
What are the types of normalization?
What is SQL Azure Fabric?
What is the command used to recompile the stored procedure at run time?
How to connect to SQL Azure Database by using sqlcmd?