oracleɾ³ý×Ö¶ÎÓï¾äÔõôд
¿ÉÒÔʹÓà alter table Óï¾äºó¸ú drop column ×Ó¾äɾ³ý oracle ±íÖеÄ×ֶΣº·¿ªÊý¾Ý¿âÅþÁ¬²¢±êʶҪɾ³ý×ֶεıíÃû¡£Ê¹Óà alter table Óï¾ä£¬Ö¸¶¨±íÃûºÍҪɾ³ýµÄ×Ö¶ÎÃû¡£Ö´ÐÐÓï¾ä¼´¿É´Ó±íÖÐÓÀÊÀɾ³ý×ֶΡ£
ÔõÑùʹÓà Oracle ɾ³ý±íÖеÄ×Ö¶Î
Òª´Ó Oracle ±íÖÐɾ³ýÒ»¸ö»ò¶à¸ö×ֶΣ¬¿ÉÒÔʹÓà ALTER TABLE Óï¾ä£¬ºó¸ú DROP COLUMN ×Ӿ䡣
Óï·¨£º
ALTER TABLE table_name DROP COLUMN column_name;
µÇ¼ºó¸´ÖÆ
°ì·¨£º
·¿ªÊý¾Ý¿âÅþÁ¬£ºÊ¹Óà preferred SQL ¿Í»§¶Ë£¨ÀýÈç SQL*Plus »ò SQL Developer£©ÅþÁ¬µ½ Oracle Êý¾Ý¿â¡£
±êʶ±íÃû£ºÖ¸¶¨Òª´ÓÖÐɾ³ý×ֶεıíµÄÃû³Æ¡£
±êʶ×Ö¶ÎÃû£ºÖ¸¶¨ÒªÉ¾³ýµÄÒ»¸ö»ò¶à¸ö×ֶεÄÃû³Æ¡£
Ö´ÐÐ ALTER TABLE Óï¾ä£ºÊ¹ÓÃÉÏÊöÓï·¨Ö´ÐÐ ALTER TABLE Óï¾ä£¬Ö¸¶¨±íÃûºÍ×Ö¶ÎÃû¡£
ʾÀý£º
Òª´ÓÃûΪ employees µÄ±íÖÐɾ³ý phone_number ×ֶΣ¬¿ÉÒÔʹÓÃÒÔÏÂÓï¾ä£º
ALTER TABLE employees DROP COLUMN phone_number;
µÇ¼ºó¸´ÖÆ
Ö´ÐдËÓï¾äºó£¬phone_number ×ֶν«´Ó employees ±íÖÐÓÀÊÀɾ³ý¡£
×¢ÖØÊÂÏ
ÔÚɾ³ý×Ö¶Î֮ǰ£¬Ó¦Ë¼Á¿Æä¶Ô±íµÄÆäËû×ֶκÍÔ¼ÊøµÄÓ°Ïì¡£
Ò»µ©É¾³ý×ֶΣ¬ÔòÎÞ·¨»Ö¸´¡£
ÈôÊÇ×Ö¶ÎÊÇÍâ¼ü£¬É¾³ýËü½«¼¶ÁªÉ¾³ýÆäËû±íÖÐÒýÓøÃ×ֶεÄÐС£
ÒÔÉϾÍÊÇoracleɾ³ý×Ö¶ÎÓï¾äÔõôдµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡