CREATE GLOBAL TEMPORARY TABLE
创建全局临时表,语法如下:
Create Global Temporary Table Temp_Name(Col1 Type1,Col2 Type2...)On Commit { Preserve | Delete } Rows;
示例
vastbase=# Create Global Temporary Table Temp_tb1 ( id int) on commit delete rows; CREATE TABLE vastbase=# insert into Temp_tb1 values (1); INSERT 0 1 vastbase=# select * from temp_tb1; id ---- (0 rows) 退出会话重新登录: [vastbase@mydb ~]$ vsql -r -d vastbase NOTICE: Last successful login info login time:2020-09-26 00:28:27.369766+08 application name:vsql Ip address:[local] method:Trust Failed 0 times since last successful login vsql ((Vastbase 2.1.0 build ) compiled at 2020-09-20 17:59:56 commit 0 last mr ) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. vastbase=# select * from temp_tb1; id ---- (0 rows)