10

I want to create table in Teradata. Therefore I am using this syntax:

    CREATE VOLATILE TABLE a AS
    (
        Select * FROM ...
    ) WITH DATA PRIMARY INDEX ( ACCOUNT_ID )
;

The inner SELECT statement results in 4 rows. However, when I run the entire query, the resulting data set does not have any rows. Strange, I know - that`s why I'm writing. Please help. Thanks.

4

1 に答える 1

37

ON COMMIT PRESERVE ROWS揮発性テーブルの DDL にオプションを含める必要があります。

   CREATE VOLATILE TABLE a AS
    (
        Select * FROM ...
    ) WITH DATA 
    PRIMARY INDEX ( ACCOUNT_ID )
    ON COMMIT PRESERVE ROWS;

COMMIT揮発性 (およびグローバル一時) テーブルのデフォルトモードDELETEは、トランザクションの最後の行です。

于 2013-06-14T16:04:24.493 に答える