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
Explain how does the report manager work in ssrs?
Explain about merge replications?
What is dynamic cursor in SQL SERVER?
Define Wed Edition in SQL Azure?
What are different types of statement?
What are the limitations/drawbacks or ssrs 2008 r2?
How to make a remote connection in a database?
What are the components of sql server service broker?
How to create dbo table in sql server?
What do you mean by an execution plan? Why is it used?
How to recreate an existing index in ms sql server?
How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?
Explain “row_number()” in sql server with an example?
What do you understand by user-defined function in the sql server and explain the steps to create and execute a user-defined function in the sql server?
What happens if the update subquery returns no rows in ms sql server?