sqlÖÐÓÃÓÚɾ³ý¼Í¼µÄÏÂÁîÊÇ
ÓÃÓÚɾ³ý¼Í¼µÄÏÂÁîÊÇdelete£¬Ó﷨Ϊ£ºdelete from table_name where condition£»ÆäÖÐconditionÖ¸¶¨ÒªÉ¾³ýÄÄЩ¼Í¼£¬ÎÞÌõ¼þɾ³ýʱֱ½ÓʹÓÃdelete from table_name£¬ÓÐÌõ¼þɾ³ýʱʹÓÃdelete from table_name where condition£¬ÀýÈçdelete from table_name where age > 30ÌåÏÖɾ³ý±íÖÐÄêËê´óÓÚ30µÄ¼Í¼¡£
SQLÖÐÓÃÓÚɾ³ý¼Í¼µÄÏÂÁî
ÔÚSQLÖУ¬ÓÃÓÚɾ³ý¼Í¼µÄÏÂÁîÊÇDELETE¡£
Óï·¨£º
DELETE FROM table_name WHERE condition;
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÆäÖУº
table_name£ºÒª´ÓÖÐɾ³ý¼Í¼µÄ±íÃû¡£
WHERE condition: ¿ÉÑ¡Ìõ¼þ£¬ÓÃÓÚÖ¸¶¨ÒªÉ¾³ýÄÄЩ¼Í¼¡£ÈôÊÇÊ¡È¥¸ÃÌõ¼þ£¬Ôò½«É¾³ý±íÖеÄËùÓмͼ¡£
Ó÷¨£º
ÎÞÌõ¼þɾ³ý£º
Ҫɾ³ý±íÖÐËùÓмͼ£¬¿ÉÒÔʹÓÃÒÔÏÂÓï·¨£º
DELETE FROM table_name;
µÇ¼ºó¸´ÖÆ
ÓÐÌõ¼þɾ³ý£º
Ҫɾ³ýÖª×ãÌض¨Ìõ¼þµÄ¼Í¼£¬¿ÉÒÔʹÓÃÒÔÏÂÓï·¨£º
DELETE FROM table_name WHERE condition;
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÀýÈ磬Ҫɾ³ý±íÖÐËùÓÐÄêËê´óÓÚ30µÄ¼Í¼£¬¿ÉÒÔʹÓÃÒÔÏÂÓï·¨£º
DELETE FROM table_name WHERE age > 30;
µÇ¼ºó¸´ÖÆ
×¢ÖØÊÂÏ
DELETEÏÂÁî²»¿ÉÄæת£¬Ò»µ©Ö´ÐУ¬ËùÑ¡¼Í¼½«ÓÀÊÀɾ³ý¡£
ÔÚʹÓÃDELETEÏÂÁî֮ǰ£¬ÇëÎñ±ØÈ·±£ÄúÍêÈ«Ã÷È·ÆäÓ°Ïì¡£
ÈôÊÇÐèÒªµõÏúɾ³ý²Ù×÷£¬ÔòÐèÒª´Ó±¸·ÝÖлָ´Êý¾Ý¡£
ÒÔÉϾÍÊÇsqlÖÐÓÃÓÚɾ³ý¼Í¼µÄÏÂÁîÊǵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡