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
Is it true, that there is no difference between a rule and a check constraint?
What are the differences between clustered and non-clustered index?
Explain primary key?
What is scd (slowly changing dimension)? : sql server analysis services, ssas
Which are new data types introduced in sql server 2008?
Explain about temporary stored procedure?
What are different types of subquery?
How to concatenate two binary strings together?
What is a dbms wizard?
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?
How to sort the query output with order by clauses in ms sql server?
How to restore performance issues and how to check?
Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?
What is an example of a foreign key?
What is the process of normalization?