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
What do you mean by sql server 2005 express management tools?
How the authentication mode can be changed?
Sql server reporting services vs. Crystal reports.
How to create new tables with "select ... Into" statements in ms sql server?
How you trouble shoot when any job fails
Explain what is the difference between a local and a global temporary table?
What is report server project?
What are recommended options to be used while using db mirroring? : sql server database administration
Can coalesce return null?
How to select all columns of all rows from a table with a select statement in ms sql server?
Can we use custom code in ssrs?
How to select true false based on column value in sql server?
Explain how to use linked server?
What is the data type of time?
What are commit and rollback in sql?