少年阿賓

          那些青春的歲月

            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
          主站蜘蛛池模板: 张家界市| 定兴县| 萨迦县| 腾冲县| 灵宝市| 湟源县| 武隆县| 兴义市| 曲麻莱县| 沂源县| 青河县| 咸阳市| 通渭县| 邯郸县| 张掖市| 海盐县| 松原市| 鞍山市| 汽车| 汉中市| 武穴市| 兰溪市| 泽普县| 昭平县| 鄂尔多斯市| 屏东市| 佛山市| 搜索| 富阳市| 云阳县| 沽源县| 松滋市| 渭源县| 舟山市| 建始县| 四会市| 凌云县| 八宿县| 楚雄市| 普定县| 平南县|