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?
Answer Posted / lakshmi narayana
select * from emp a ,
(select empno,count(*) from emp group by empno having count
(*) > 1) b
where a.empno = b.empno
| Is This Answer Correct ? | 27 Yes | 10 No |
Post New Answer View All Answers
Explain some predefined exceptions.
What are sql procedures?
What does subquery mean in sql?
what is a materialized view? : Sql dba
Does inner join return duplicate rows?
Explain the uses of database trigger.
Are views faster than queries?
Does truncate release storage space?
Is and as keyword in pl sql?
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
Can we perform dml on view?
Can we create a trigger on view?
what is difference between delete and truncate commands? : Sql dba
What is blind sql injection?
Why we use sql profiler?