Submitted Questions

  • Deleting duplicate records in a table without using rowid

    1. How to delete a duplicate records in a table without using rowid? 2. What is the use of Connect by clause? 3. What is the use of Connect by clause? 4. How to display "Experience of employee"?E.g. 3 years 4 months 19 days? 5. What is select statement to spe?

    Muralidhar

    • Apr 6th, 2012

    We delete the duplicate records using level and rownum. The query is

    Code
    1. DELETE FROM emp WHERE ROWNUM IN(SELECT MAX(ROWNUM) FROM emp WHERE LEVEL=nth CONNECT BY PRIOR empno>empno GROUP BY LEVEL);