Search This Blog

Monday, May 21, 2018

Delete Multiple Row From A Table in Oracle

DECLARE
   V_COUNT   NUMBER;
BEGIN
   DELETE FROM EMPLOYEES
         WHERE ROWID IN (SELECT ROWID
                         FROM (SELECT ROWID,
                               ROW_NUMBER ()
                               OVER (PARTITION BY EMPLOYEE_ID
                                     ORDER BY 1)ROW_NO
                                   FROM EMPLOYEES)
                          WHERE ROW_NO > 1);
   V_COUNT := SQL%ROWCOUNT;
   DBMS_OUTPUT.PUT_LINE(V_COUNT);
END;

No comments:

Post a Comment

Create a Form Using Python for Save Data into Excel like a Database

#Download Pyhton from here https://www.python.org/downloads/  #Download Python: #Click the “Download Python 3.x.x” button (the latest versio...