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 is factless fact table? : sql server analysis services, ssas
What is Federation Root Database?
What is the sql server agent?
What are the disadvantages of merge replication?
What is the significance of null value and why should we avoid permitting null values?
how would you improve etl (extract, transform, load) throughput?
How does a profiler work?
What are the different types of sql server replication? : sql server replication
What are scalar functions in sql?
Explain what are the authentication modes in sql server?
Why do we use functions?
How to disconnect from a sql server using mssql_close()?
How can we check the sql server version?
Tell me what is fill factor?
What are the rendering extensions of ssrs?