当前位置:网站首页>oracle对表字段的修改
oracle对表字段的修改
2022-04-23 06:05:00 【旺财2】
主要操作:1.添加字段;2.删除字段;3.修改字段(修改字段的类型,修改字段的长度)
1.添加字段:
总是可以成功,新添加的字段出现在表的最后面。
alter table student
add tel varchar2(11);
alter table student
add addr varchar2(11);
2.删除字段:
总是可以成功,不管是否有数据,都可以删除掉。
alter table student
drop column addr
3.修改字段:
A.在该字段没有数据的时候,字段的类型,字段的长度都是可以修改的。
alter table student
modify tel number(11);
alter table student
modify addr varchar(20);
B.对于缺省值的修改,不会影响已经存在的数据,只会对以后插入的数据产生影响。
alter table student
modify sex char(2) default '女';
C.当该字段有数据的时候字段的类型是不能修改的,但是字段的长度是可以修改的(长度增大可以,变小要看数据的实际长度)。
alter table student
modify grade varchar(8);
版权声明
本文为[旺财2]所创,转载请带上原文链接,感谢
https://blog.csdn.net/wdyliuxingfeiyang/article/details/121513079
边栏推荐
- Kubernetes CoreDNS常见问题资料参考
- Winter combat camp hands-on combat - first understand the cloud foundation, hands-on practice ECS ECS ECS novice on the road to get the mouse cloud Xiaobao backpack shadowless
- 异常记录-20
- Chaos带你快速上手混沌工程
- oracle存储过程中is和as区别
- Typical application scenarios of alicloud log service SLS
- switch case时连写常规判断表达式的错误 case和if并用 l
- Exception record-14
- 冬季实战营动手实战-上云必备环境准备,动手实操快速搭建LAMP环境 领鼠标 云小宝 背包 无影
- Abnormal record-21
猜你喜欢

Typical application scenarios of alicloud log service SLS

Dolphinscheduler调度sql任务建表时The query did not generate a result set异常解决

mysql和pgsql时间相关操作

Prometheus cortex Architecture Overview (horizontally scalable, highly available, multi tenant, long-term storage)

Build a cloud blog based on ECS (send blessings on the cloud Xiaobao code and draw iphone13 for free)

Memcached source code analysis

Prometheus的relabel_configs和metric_relabel_configs解释及用法示例

Winter combat camp hands-on combat - cloud essential environment preparation, hands-on practical operation, quickly build lamp environment, lead mouse cloud Xiaobao backpack without shadow

Practice using polardb and ECs to build portal websites

BPF program of type XDP
随机推荐
oracle库恢复数据
Ali vector library Icon tutorial (online, download)
Virtio and Vhost_ Net introduction
OSS云存储管理实践(体验有礼)
解决:You have 18 unapplied migration(s). Your project may not work properly until you apply
Comparison between Prometheus thanos and cortex components
Dolphinscheduler配置Datax踩坑记录
异常记录-11
异常记录-16
Introduction to RDMA
Use the SED command to process text efficiently
异常记录-21
Abnormal record-17
Typical application scenarios of alicloud log service SLS
Introduction to RDMA network
Prometheus监控influxdb的方法及指标释义
pg库查看某模式下某表的分布键
Winter combat camp hands-on combat - first understand the cloud foundation, hands-on practice ECS ECS ECS novice on the road to get the mouse cloud Xiaobao backpack shadowless
switch case时连写常规判断表达式的错误 case和if并用 l
RAC环境alert日志报错Drop transient type: SYSTP2JW0acnAurDgU1sBqMBryw==的排查