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 control chart?
how cam www sites be tested
What is api (application programming interface)?
Hi,Iam learning software testing now.i want to put 2+ yrs exp:.Is there any problem with fake exp:.how to prepair for the Interview. Thank u
What is service pack..what is the purpose of this..?This question was asked in an testing interview..that's why i posted this in this category..
1 Answers Infeneon Technologies,
hai, i completed my B.Tech.i planning to join in testing tools.can anybody suggest me good institute.I heard about Nageshwara Rao sir institute for testing tools.Now which one is good so i can get job in testing tools. please help me.....where to join in hyd.
Which tool you use to debug SQL Queries
What is dre?
What is Recovery Scenario
who does the security check on the web site, other than login/password screens ?
If you have an application, but you do not have any requiremnts available, then how would you perform the testing
How to answer when the interviewer asked "what is your project architecture?" pls. tell me in general ..