Click here to Skip to main content
15,893,790 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to find and save the duplicate values in same table?
Posted
Updated 24-Feb-14 21:06pm
v5
Comments
Kornfeld Eliyahu Peter 25-Feb-14 2:32am    
Have you done anything so far? Show some effort (code or searching)! As is it ain't a question...
Sai Prasad anumolu 25-Feb-14 2:34am    
hey this is qustion .....What r u doing .....Do not involve my communication
Kornfeld Eliyahu Peter 25-Feb-14 2:55am    
That way you communicating no-one...
If you can't provide more details you probably will not get any answers!
Sai Prasad anumolu 25-Feb-14 2:58am    
actually , You are Option ...Not question , So, I am very confusing, Please , U will not mention not question ....sir ..Y because i have so many douts in .net
♥…ЯҠ…♥ 25-Feb-14 3:02am    
Using SQL Insert command ;-),I reckon you do not want this sort of answers, so try to put your question clear as much as you can

1 solution

Have a look at example:
SQL
DECLARE @tbl TABLE (ID INT IDENTITY(1,1), SomeData VARCHAR(30))

INSERT INTO @tbl (SomeData)
VALUES('a'),('b'),('c'),
    ('a'),('d'),('e'),
    ('d'),('b'),('f'),
    ('h'),('g'),('c')

--display all
SELECT ID, SomeData
FROM @tbl

--display duplicates
SELECT SomeData, COUNT(SomeData) AS CountOfSomeData
FROM @tbl
GROUP BY SomeData
HAVING COUNT(SomeData)>=1


For further information, please see:
Eliminating Duplicates with DISTINCT[^]
Find and/or Delete Duplicate Rows[^]
Find Duplicates using LINQ[^]

Note: you should provide more details about your issue, at least sample data and expected output.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900