【oracle】常用表操作语句
-- 创建emp1表 create table emp1( id int, name nvarchar2(20), dept int, primary key(id)); -- 给emp1表插测试值 insert into emp1 select rownum, dbms_random.string('*',dbms_random.value(6,20)), dbms_random.value(1,6) from dual connect by level<2001; -- 增加age列 alter table emp1 add(age int); -- 更新列数据 update emp1 set age=mod(id,100) where 1=1; -- 更改列名dept为deptid alter table emp1 rename column dept to deptid; -- 给表改名 alter table emp1 rename to emp2;
参考资料:https://www.cnblogs.com/ggll611928/p/5981498.html
END