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

PDF to Text Covert by Oracle Apex

Here are the steps to convert and get the character into a region by Oracle Apex. Step1.  Create a page and Copy-Pest the below code into Pa...