PLSQL 的简单命令之四
生活随笔
收集整理的這篇文章主要介紹了
PLSQL 的简单命令之四
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
-- 子查詢
-- in 等于表中的任意一個
select * from Stu
where id in (select id from scores)-- 和子查詢返回結果中的某一個值比較成立即可
select * from scores
where id > all (select id from stu )-- 和子查詢返回結果中的所有值比較
select * from scores
where id > any (select id from stu )select * from stu
-- 追加一個列或多個列(字段)
alter table stu add (age number,address varchar2(5))-- 修改一個列(字段)
-- 修改字段的尺寸
alter table stu modify (address varchar2(23))-- 修改字段的數據類型
alter table stu modify (address number )-- 刪除一個列(字段)
alter table stu drop column address -- 刪除多列
alter table stu drop (age,address)-- 列重命名
alter table stu rename column name to lastname-- 清空表
truncate table testselect * from test
insert into test (id) values (4)
--commit會默認創建節點
commitinsert into test (id) values (5)
-- 回滾到上一個節點
rollback-- 創建指定節點
savepoint dome
insert into test (id) values (9)-- 回滾到指定節點
rollback to dome
?
轉載于:https://www.cnblogs.com/lantu1989/p/6121225.html
總結
以上是生活随笔為你收集整理的PLSQL 的简单命令之四的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql权限与安全
- 下一篇: 进击的docker 二 : docker