1、Oracle语句之数据定义语言(DDL)1) CREATE TABLE 新建表2) ALTER TABLE 修改表3) TRUNCATE TABLE 清空表数据 举例:truncate table stu;4) ...
1、Oracle语句之数据定义语言(DDL)
1) CREATE TABLE 新建表
2) ALTER TABLE 修改表
3) TRUNCATE TABLE 清空表数据 举例:truncate table stu;
4) DROP TABLE 删除表
alter用法:
1、在表中新增字段:
alter table stu add age int;
2、在表中删除字段:
alter table stu drop column age;
3、对字段改名:
alter table stu rename column sid to s#;
4、对字段改数据类型:
alter table test00 modify ssid varchar2(10);
注:列非空时不能更改字段的数据类型
此时可以通过如下方法做修改:
新建列B—把A列数据导入—清空A列—转换A列类型—把B别数据转换导入。
举例:
alter table stu add sss float;
update stu set sss=shigh;
update stu set shigh = null;
alter table stu modify shigh varchar2(10);
update stu set shigh = sss;
alter table stu drop column sss;
2、Oracle语句之数据操纵语言(DML)
数据操纵语言(DML):select delete update insert
1.插入数据INSERT
当插入的数据 顺序、数量和表一致,可省略列名。
insert into stu values();
当插入的数据 顺序或者数量和表不一致,必须指明列名。2.更新数据UPDATE
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:Oracle语句分类汇总
关键词:oracle
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。