oracle 学习笔记

来源:互联网 发布:淘宝外卖优惠券怎么领 编辑:程序博客网 时间:2024/06/05 18:51

临时表的创建方式:

SQL> 1. 手动: create global temporary table *****SQL> 2. 自动:排序SQL> 特点:当事务或者会话结束的时候,表中自动删除
--SQL> --基于会话的临时表SQL> create global temporary table temptest1  2  (tid number,tname varchar2(20))  3  on commit delete rows;表已创建。SQL> insert into temptest1 values(1,'Tom');已创建 1 行。SQL> select * from temptest1;       TID TNAME                                                                                                                                                                                        ---------- --------------------                                                                                                                                                                                  1 Tom                                                                                                                                                                                          SQL> commit;提交完成。SQL> select * from temptest1;未选定行
SQL> --基于会话的临时表SQL> create global temporary table temptest1SQL> (tid number,tname varchar2(20))SQL> on commit preserve rows;
原创粉丝点击