How to retrieve Duplicate Rows only in a Table?
Suppose if a Table Name is "Education". It consists of
multiple columns. Then if we insert rows into this table
with duplicate records then how can we retrieve only
duplicate records from that table?

Answers were Sorted based on User's Feedback



How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / satheesh

SELECT * FROM EDUCATION E1 WHERE ROWID>(SELECT MIN(ROWID)
FROM EDUCATION E2 WHERE E1.EMPID=E2.EMPID)

Is This Answer Correct ?    0 Yes 0 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / sirisha

select id,count(id) from Education group by id having count(id)>1

Is This Answer Correct ?    0 Yes 0 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / aditi yadav

SELECT *FROM Employee
WHERE JoiningDate >= DATEADD(M, -2, GETDATE())

Is This Answer Correct ?    0 Yes 0 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / karthik

i think ths will work!
select * from table_name where rowid in (select max
(rowid) from table_name groupby duplicate_field_name);

Is This Answer Correct ?    0 Yes 1 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / lavanya

SELECT COUNT(*), <COLUMN_NAME> FROM EDUCATION GROUP BY
<COLUMN_NAME>

Is This Answer Correct ?    10 Yes 14 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / guest

unionall

Is This Answer Correct ?    1 Yes 5 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / dawood

SELECT COUNT(EMPNO),ENAME FROM EDUCTION
GROUP BY ENAME;

Is This Answer Correct ?    5 Yes 10 No

How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". ..

Answer / harish

select * from education where rownum < ( select max(rownum)
from education group by <column_name> )

Is This Answer Correct ?    15 Yes 24 No

Post New Answer

More SQL PLSQL Interview Questions

What is oracle sql called?

0 Answers  


What does bitemporal mean?

0 Answers  


what is self join and how it works??

2 Answers   Infosys,


Can we insert data in view?

0 Answers  


What is window clause?

1 Answers   TCS,






Define join and name different types of joins?

0 Answers  


explain mysql aggregate functions. : Sql dba

0 Answers  


What is dense_rank in sql?

0 Answers  


What is scalar function in sql?

0 Answers  


What is the maximum rows in csv?

0 Answers  


What is a nested table in word?

0 Answers  


What are functions in sql?

0 Answers  


Categories