-4

I have a very huge data but some of data has been duplicated such as for Example First Row has name "Sushil" and other row has name "Sushil and Other" the relevant details of both rows are same. So how can i find such a data. Please Help..!

Takarii
  • 1,612
  • 2
  • 18
  • 29
Sushiloo
  • 25
  • 1
  • 5

2 Answers2

1

You have to write the aggregate functions to find the counts of duplicated fields (By using Group By Clause).

refer the below answer

StackOverflow Answer

Community
  • 1
  • 1
BOBIN JOSEPH
  • 1,012
  • 8
  • 25
0

Suppose you have this table

CREATE TABLE [dbo].[Table_1](
    [name] [nchar](10) NULL,
    [age] [int] NULL
) ON [PRIMARY]

you can execute the following query on this table

SELECT t.*, COUNT(*) as DuplicateRecords
FROM Table_1 t
group by t.name,t.age having COUNT(*)>=2

the result set would contain rows that are duplicated.

Sam
  • 2,935
  • 1
  • 19
  • 26
  • I still not get the Answer...Brother – Sushiloo May 07 '16 at 05:01
  • can you please elaborate as to why you are still having problems ? – Sam May 09 '16 at 04:29
  • Brother..your query is executing properly..but not in way that i want – Sushiloo May 09 '16 at 12:32
  • My problem is that I want to show all data that is entered as in For Ex. in a First_name column First_name is "SUSHIL" and somewhere in another row within same column i.e. in First_name data is enterd as "SUSHIL and Other" and other details like mob. No and etc of both "SUSHIL" and "SUSHIL and Other" is same i.e. Repeated – Sushiloo May 09 '16 at 12:36
  • `select * from table where firstname like '%and Other%'` Execute this query – Sam May 10 '16 at 05:14