Series: Subject: Topic:
Question: 113 of 216

How to display duplicate rows in a table?

Select * from emp where deptno=any
(select deptno from emp having count(deptno)>1 group by deptno);
Asked by: Interview Candidate | Asked on: Jul 29th, 2006
Showing Answers 1 - 9 of 9 Answers

Answered On : Aug 3rd, 2006

select * from emp group by (empid)having count(empid)>1

Login to rate this answer.

Answered On : Aug 12th, 2006

empidempnameempsal1yakhub200001yakhub200002pasha10000    if the table is like this                   Delete from emp where          Rowid not in (select min(rowid) from emp        Groupby (empid,empname,empsal));

Login to rate this answer.

Answered On : Aug 24th, 2006

select distinct empid,empname,empsal from emp;

Login to rate this answer.

select * from emp where empid in(select empid from emp group by empid having count(*)>1);

Login to rate this answer.
Sudeep Biswas

Answered On : Nov 8th, 2006

One more way to find out dupl. rows in a table (t_empolyee in this case) is:-------------------------------select emp_id, desg from t_employee t1 where( select count(*) from employee t2where t2.emp_id = t1.emp_id) > 1---------------------------------

Login to rate this answer.
Vijay Akumalla

Answered On : Dec 13th, 2006

Dear All, Let us use this space to answer questions correctly, instead of guess work. This website should be used to gain knowledge in the correct direction.

Login to rate this answer.

Answered On : Feb 22nd, 2007

Select * from tablename t1 where 1<(select * from tablename t2 where t1.col1=t2.col1);

Login to rate this answer.

Answered On : Mar 26th, 2009

View all answers by mayank1710

Select * from acctcycle where acct_nbr in (select acct_nbr from acctcycle group by acct_nbr having count(acct_nbr)>1);

Login to rate this answer.

Answered On : Jan 20th, 2010

View all answers by ashwani7jul

DELETE FROM test USING test, test AS vtable WHERE (test.ID > vtable.ID) AND ( duplicate records  query  

Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions



twitter fb Linkedin GPlus RSS


Interview Question

 Ask Interview Question?


Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.