sqlÖÐÐ޸ıíÃûµÄÏÂÁî
sql ÖÐʹÓà alter table Óï¾äÐ޸ıíÃû£¬°ì·¨ÈçÏ£º1£©È·ÈÏȨÏÞ£»2£©±àдÓï¾ä£¨alter table rename to £©£»3£©Ö´ÐÐÓï¾ä¡£×¢ÖØÊÂÏԱí±ØÐè±£´æ¡¢ÐÂ±í²»¿ÉÒѱ£´æ£¬Ð޸ĺó¿ÉÄÜÓ°ÏìÒÀÀµ¹Øϵ£¬±íÃûº¬ÌØÊâ×Ö·ûʱÐè¼ÓÒýÓñêʶ·û¡£
SQL Ð޸ıíÃûÏÂÁî
ÔÚ SQL ÖУ¬¿ÉÒÔʹÓà ALTER TABLE Óï¾äÀ´Ð޸ıíÃû¡£Óï·¨ÈçÏ£º
ALTER TABLE RENAME TO ;
µÇ¼ºó¸´ÖÆ
ʹÓð취
È·ÈÏȨÏÞ£ºÈ·±£ÓµÓжÔÔ±í¾ßÓÐ×ã¹»µÄȨÏÞ£¬°üÀ¨ÖØÃüÃû±íµÄȨÏÞ¡£
±àдÓï¾ä£ºÆ¾Ö¤ÉÏÊöÓï·¨±àд ALTER TABLE Óï¾ä¡£
Ö´ÐÐÓï¾ä£ºÔÚ SQL ÏÂÁîÌáÐÑ·û»ò¹¤¾ßÖÐÖ´ÐÐÓï¾ä¡£
×¢ÖØÊÂÏî
Ô±í²»±£´æ£ºÈôÊÇÔ±í²»±£´æ£¬ÔòÖØÃüÃû²Ù×÷½«Ê§°Ü¡£
бíÒѱ£´æ£ºÈôÊÇÄ¿µÄбíÒѱ£´æ£¬ÔòÖØÃüÃû²Ù×÷Ò²»áʧ°Ü¡£
ÒÀÀµ¹Øϵ£ºÈôÊÇÔ±í±£´æÓëÆäËû¹¤¾ß£¨ÈçÔ¼Êø¡¢Ë÷Òý¡¢ÊÓͼµÈ£©µÄÒÀÀµ¹Øϵ£¬ÔòÖØÃüÃû²Ù×÷¿ÉÄÜ»áÓ°ÏìÕâЩÒÀÀµ¹ØϵµÄÓÐÓÃÐÔ¡£
ʹÓÃÒýÓñêʶ·û£ºÈôÊDZíÃû°üÀ¨ÌØÊâ×Ö·û»ò±£´æ×Ö£¬Ôò±ØÐèʹÓÃÒýÓñêʶ·û£¨ÈçË«ÒýºÅ»ò·½À¨ºÅ£©½«ÆäÀ¨ÆðÀ´¡£
ʾÀý
Òª½«±íÃû old_table ÐÞ¸ÄΪ new_table£¬¿ÉÒÔʹÓÃÒÔÏÂÓï¾ä£º
ALTER TABLE old_table RENAME TO new_table;
µÇ¼ºó¸´ÖÆ
ÒÔÉϾÍÊÇsqlÖÐÐ޸ıíÃûµÄÏÂÁîµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡