How to find out duplicate records in a table(Query)
Answers were Sorted based on User's Feedback
Answer / vishal
try this query
select name,count(*) from X1 (X1 being the table name)
group by name
having count(*)>1
| Is This Answer Correct ? | 12 Yes | 2 No |
Answer / madhav
select name,count(name) from mastertable group by name
having count(name)>1
instead of NAME use your own fields
Best of luck
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / santosh
we have to use the group by with having command to get the duplicate values. this query shall show the result of only the users have duplicate values in the employee table.
Syntex:
Select columnName From Table_name
Group By columnName
Having count (*) > 1
Example:
SELECT UserID FROM employee
GROUP BY userid
HAVING count( * ) > 1
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / deepika galankar
if table " stud " contains data :
studid name
1 xyz
2 pqr
3 per
1 xyz
then query is
select name ,count(name) from stud
group by name
having count(name)>1;
thank u .
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / lakshmanlal
hi gud evening all, this is lakshmanlal.k.
suppose my table EMP having one column like ENAME in that i
am having 5 values like lakshman,lakshman,siva,rajesh,kiran
now i am writing query for duplicate records
select ename from EMP(tablename)
group by ename
having count(ename)>1
| Is This Answer Correct ? | 0 Yes | 1 No |
What is RC update and BRIO?
Can nyone tell me about the testing certifications. I have planned to give a certification exam, but dont know which 1 is good.
How will you conduct risk analysis?
what is database testing?
What is negative and positive testing?
Functional testing?
test scenarios for downloading a file
I'm in search of a test management system that can handle the tasks for instance of a manager or a tester equally well Can anyone help you in this?
Explain beta testing?
18). explain testing process in your organization? 19). are you participated in test plan preparation? 20). how will you prepare test cases? 21). explain importance of the priority in test case documents? 22). explain test execution process? 23). how much time will you take to write one test case? 24). how many test cases you can execute in a day? 25). explain bug life cycle? explain difference between seveority & priority?
when we need testing
What is the difference between Testing and Code review?