mysqlÖÐɾ³ý¼Í¼µÄÏÂÁî
mysql ÖÐɾ³ý¼Í¼µÄÏÂÁîÊÇ delete¡£ÆäÓ﷨Ϊ£ºdelete from table_name where condition;ÆäÖУ¬table_name ÊÇÄ¿µÄ±í£¬condition ÊÇ¿ÉÑ¡µÄɾ³ýÌõ¼þ¡£ÈôÊÇδָ¶¨Ìõ¼þ£¬Ôòɾ³ý±íÖÐËùÓмͼ¡£
MySQL ÖÐɾ³ý¼Í¼µÄÏÂÁî
ɾ³ý¼Í¼ÏÂÁDELETE
ÔÚ MySQL ÖУ¬Ê¹Óà DELETE ÏÂÁî¿ÉÒÔ´Ó±íÖÐɾ³ý¼Í¼¡£ÆäÓï·¨ÈçÏ£º
DELETE FROM table_name WHERE condition;
µÇ¼ºó¸´ÖÆ
ÆäÖУº
table_name ÊÇÒª´ÓÖÐɾ³ý¼Í¼µÄ±íÃû¡£
condition ÊÇÒ»¸ö¿ÉÑ¡µÄÌõ¼þ£¬ÓÃÓÚÖ¸¶¨ÒªÉ¾³ýÄÄЩ¼Í¼¡£ÈôÊÇûÓÐÖ¸¶¨Ìõ¼þ£¬Ôò»áɾ³ý±íÖеÄËùÓмͼ¡£
ʾÀý£º
ɾ³ý users ±íÖоßÓÐ ID Ϊ 1 µÄ¼Í¼£º
DELETE FROM users WHERE user_id = 1;
µÇ¼ºó¸´ÖÆ
×¢ÖØ£º
DELETE ÏÂÁî²»¿ÉÄ棬һµ©Ö´ÐоÍÎÞ·¨µõÏú¡£Òò´Ë£¬ÔÚʹÓÃÇ°ÇëÈ·±£ÄúÒÑ׼ȷѡÔñÁËҪɾ³ýµÄ¼Í¼¡£
WHERE ×Ó¾ä¿ÉÒÔ°üÀ¨¶à¸öÌõ¼þ£¬Ê¹Óà AND »ò OR ÅþÁ¬¡£
ÈôÊÇδָ¶¨ WHERE ×Ӿ䣬Ôò»áɾ³ý±íÖеÄËùÓмͼ£¬Õâ¿ÉÄܵ¼ÖÂÊý¾Ýɥʧ¡£
ÒÔÉϾÍÊÇmysqlÖÐɾ³ý¼Í¼µÄÏÂÁîµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡