当前位置:网站首页>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
边栏推荐
- Chaos takes you to the chaos project quickly
- 异常记录-8
- mysql和pgsql时间相关操作
- RAC环境alert日志报错Drop transient type: SYSTP2JW0acnAurDgU1sBqMBryw==的排查
- 将数组中指定的对象排在数组的前边
- Dolphinscheduler调度sql任务建表时The query did not generate a result set异常解决
- 阿里云日志服务sls的典型应用场景
- pg库查看某模式下某表的分布键
- RAC环境数据库节点参数设置不当导致监听无法连接问题排查
- 冬季实战营 动手实战-初识上云基础,动手实操ECS云服务器新手上路 领鼠标 云小宝 背包 无影
猜你喜欢
Chaos takes you to the chaos project quickly
Dolphinscheduler调度spark任务踩坑记录
Chaos带你快速上手混沌工程
BPF program of type XDP
Oracle redo log产生量大的查找思路与案例
Build a cloud blog based on ECS (send blessings on the cloud Xiaobao code and draw iphone13 for free)
Virtio and Vhost_ Net introduction
Static interface method calls are not supported at language level ‘5‘ 异常解决
Thanos compact component test summary (processing historical data)
Typical application scenarios of alicloud log service SLS
随机推荐
Dolphinscheduler集成Flink任务踩坑记录
oracle undo使用率高问题处理
常用于融合去重的窗口函数row_number
qs.stringify 接口里把入参转为&连接的字符串(配合application/x-www-form-urlencoded请求头)
异常记录-17
Prometheus Thanos快速指南
Construire un blog Cloud basé sur ECS (bénédiction sur le Code Cloud Xiaobao, explication détaillée de la tâche iphone13 gratuite)
Apache Atlas 编译及安装记录
Chaos takes you to the chaos project quickly
oracle计算两日期相差多少秒,分钟,小时,天
异常记录-19
Practice using polardb and ECs to build portal websites
Abnormal record-16
Oracle和mysql批量查询用户下所有表名和表名注释
How does VirtualBox modify the IP network segment assigned to the virtual machine in the "network address translation (NAT)" network mode
Introduction to RDMA
qs. In the stringify interface, the input parameter is converted into a & connected string (with the application / x-www-form-urlencoded request header)
switch case时连写常规判断表达式的错误 case和if并用 l
"Write multi tenant" implementation of Prometheus and thanos receiver
OVS and OVS + dpdk architecture analysis