oracleɾ³ýÓï¾äÔõôд
oracleÖУ¬Ê¹ÓÃdeleteÓï¾äɾ³ýÊý¾Ý£¬Ó﷨Ϊdelete from table_name where condition£»È·¶¨ÒªÉ¾³ýµÄ±í£¬Ö¸¶¨Ìõ¼þѡժҪɾ³ýµÄÐУ¬±àдdeleteÓï¾ä¼´¿É¡£
Oracle ɾ³ýÓï¾ä
ÔÚ Oracle Êý¾Ý¿âÖУ¬Ê¹Óà DELETE Óï¾äɾ³ý±íÖеÄÊý¾Ý¡£Óï·¨ÈçÏ£º
DELETE FROM table_name WHERE condition;
µÇ¼ºó¸´ÖÆ
ÆäÖУº
table_nameÊÇҪɾ³ýÊý¾ÝµÄ±íÃû³Æ¡£
conditionÊÇÓÃÓÚÖ¸¶¨ÒªÉ¾³ýÄÄЩÐеĿÉÑ¡Ìõ¼þ¡£ÈôÊÇûÓÐÖ¸¶¨Ìõ¼þ£¬Ôò½«É¾³ý±íÖеÄËùÓÐÐС£
ÔõÑùд DELETE Óï¾ä
È·¶¨ÒªÉ¾³ýÊý¾ÝµÄ±í¡£
Ö¸¶¨Ò»¸öÌõ¼þÒÔѡժҪɾ³ýµÄÐС££¨¿ÉÑ¡Ï
ʹÓÃÉÏÊöÓï·¨±àд DELETE Óï¾ä¡£
ʾÀý
ÒÔÏÂʾÀýɾ³ý±í “customers” ÖÐÃûΪ “John Doe” µÄ¿Í»§£º
DELETE FROM customers WHERE name = 'John Doe';
µÇ¼ºó¸´ÖÆ
ÌáÐÑ
ÔÚÖ´ÐÐ DELETE Óï¾ä֮ǰ£¬ÇëÈ·±£ÄúÏàʶ½«É¾³ýÄÄЩÊý¾Ý£¬ÓÉÓÚɾ³ý²Ù×÷ÊDz»¿ÉÄæµÄ¡£
ʹÓÃÌõ¼þ¿É×ÊÖúÄúɾ³ýÌض¨µÄÐУ¬´Ó¶ø×èÖ¹ÒâÍâɾ³ýÊý¾Ý¡£
ÈôÊÇÄúҪɾ³ý´ó×ÚÊý¾Ý£¬ÇëʹÓà TRUNCATE TABLE Óï¾ä£¬ÓÉÓÚËü±È DELETE Óï¾ä¸ü¿ìÇÒ²»»á´¥·¢´¥·¢Æ÷¡£
ÒÔÉϾÍÊÇoracleɾ³ýÓï¾äÔõôдµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡