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
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 |
Answer / sirisha
select id,count(id) from Education group by id having count(id)>1
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / aditi yadav
SELECT *FROM Employee
WHERE JoiningDate >= DATEADD(M, -2, GETDATE())
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / keerthana
select Student_Name,Dgree from Education
group by (Student_Name,Dgree) having count(*) > 1;
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
Answer / lavanya
SELECT COUNT(*), <COLUMN_NAME> FROM EDUCATION GROUP BY
<COLUMN_NAME>
| Is This Answer Correct ? | 10 Yes | 14 No |
Answer / dawood
SELECT COUNT(EMPNO),ENAME FROM EDUCTION
GROUP BY ENAME;
| Is This Answer Correct ? | 5 Yes | 10 No |
Answer / harish
select * from education where rownum < ( select max(rownum)
from education group by <column_name> )
| Is This Answer Correct ? | 15 Yes | 24 No |
What is package in pl sql with an examples?
Why do we use triggers?
What is db journal file?
7. Where would you look for errors from the database design?
how a reference cursor works?what all adnvantages are gained with it..specify the situation?
what is the correct way of selection statement a. select/from/table_name/orderby/groupby/having b. select/from/table_name/groupby/having/orderby
5 Answers HCL, JPMorgan Chase,
How many types of triggers exist in pl/sql?
How do I enable sql encryption?
Is progress software supports to ( pl/sql )?
give the syntax of grant and revoke commands? : Sql dba
four procedures is are there should i write their in a package
What is NOCOPY?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)