如何使用ANSI SQL创建临时表?

时间:2017-07-20 17:15:26

标签: database oracle ansi-sql

我想使用ANSI SQL创建一个临时表,以便我可以使用相同的查询在ORACLE和MSSQL中创建表。

1 个答案:

答案 0 :(得分:-1)

Create temporary table using the following statement

 CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      id           NUMBER,
      description  VARCHAR2(20)
   )
  ON COMMIT PRESERVE ROWS;


   ON COMMIT PRESERVE ROWS clause indicates that rows should persist beyond the end of the transaction. They will only be removed at the end of the session.