少年阿賓

          那些青春的歲月

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks
          SQL> create table lee(id number,name varchar2(100),score number,constraint pk_lee primary key(id));
           
          Table created

           SQL> desc lee
          Name  Type          Nullable Default Comments
          ----- ------------- -------- ------- --------
          ID    NUMBER                                 
          NAME  VARCHAR2(100) Y                        
          SCORE NUMBER        Y                        
           
          SQL> alter table lee add createtime date;
           
          Table altered
           
          SQL> desc lee
          Name       Type          Nullable Default Comments
          ---------- ------------- -------- ------- --------
          ID         NUMBER                                 
          NAME       VARCHAR2(100) Y                        
          SCORE      NUMBER        Y                        
          CREATETIME DATE          Y                        
           
          SQL> alter table lee modify createtime nvarchar2(100);
           
          Table altered
           
          SQL> desc lee
          Name       Type           Nullable Default Comments
          ---------- -------------- -------- ------- --------
          ID         NUMBER                                  
          NAME       VARCHAR2(100)  Y                        
          SCORE      NUMBER         Y                        
          CREATETIME NVARCHAR2(100) Y                        
           
          SQL> alter table lee rename column createtime to mytime;
           
          Table altered
           
          SQL> desc lee
          Name   Type           Nullable Default Comments
          ------ -------------- -------- ------- --------
          ID     NUMBER                                  
          NAME   VARCHAR2(100)  Y                        
          SCORE  NUMBER         Y                        
          MYTIME NVARCHAR2(100) Y                        
           
          SQL> alter table lee modify mytime date;
           
          Table altered
           
          SQL> desc lee
          Name   Type          Nullable Default Comments
          ------ ------------- -------- ------- --------
          ID     NUMBER                                 
          NAME   VARCHAR2(100) Y                        
          SCORE  NUMBER        Y                        
          MYTIME DATE          Y                        
           
          SQL> desc lee
          Name   Type          Nullable Default Comments
          ------ ------------- -------- ------- --------
          ID     NUMBER                                 
          NAME   VARCHAR2(100) Y                        
          SCORE  NUMBER        Y                        
          MYTIME DATE          Y                         
                            
           
          SQL> alter table lee rename column mytime to createtime;
           
          Table altered
           
          SQL> desc lee
          Name       Type          Nullable Default Comments
          ---------- ------------- -------- ------- --------
          ID         NUMBER                                 
          NAME       VARCHAR2(100) Y                        
          SCORE      NUMBER        Y                        
          CREATETIME DATE          Y                         
           
          SQL> alter table lee drop column createtime;
           
          Table altered
           
          SQL> desc lee
          Name  Type          Nullable Default Comments
          ----- ------------- -------- ------- --------
          ID    NUMBER                                 
          NAME  VARCHAR2(100) Y                        
          SCORE NUMBER        Y                        
           
          SQL>
          posted on 2012-12-03 10:51 abin 閱讀(578) 評論(0)  編輯  收藏 所屬分類: oracle
          主站蜘蛛池模板: 西乌珠穆沁旗| 辽阳市| 嘉善县| 祥云县| 小金县| 江阴市| 微博| 元氏县| 诏安县| 河北省| 黄梅县| 明星| 阜平县| 兰坪| 洪洞县| 呼和浩特市| 柏乡县| 泗洪县| 车致| 宽甸| 苗栗县| 札达县| 梅州市| 湖北省| 繁昌县| 甘德县| 织金县| 嘉荫县| 平谷区| 南澳县| 崇仁县| 玉溪市| 海盐县| 石门县| 北宁市| 获嘉县| 仁怀市| 微博| 搜索| 呼伦贝尔市| 县级市|