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

Answer Posted / vamsi

select id,Lastname, firstname from record where FirstName like 'Hoffman%' or LastName='Zach'

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about SQL server 2005?

742


How do you set a trace flag in sql server?

748


Why is the need for data conversion transformations?

692


What happens when unicode strings concatenate with non-unicode strings?

733


Explain for xml explicit mode?

734






What are types of scd? : sql server analysis services, ssas

724


What are SSL and TSL protocols?

747


How to select true false based on column value in sql server?

707


How do we Backup SQL Azure Data?

98


What are trace flags?

765


Define normalisation?

865


1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?

1724


How do you troubleshoot errors in a SQL Server Agent Job?

744


What is the primary use of the model database?

796


Describe and explain about SQL native client?

786