I tried to mix the CREATE TABLE table_name AS SELECT .... statement with the GLOBAL outer table statement. They do not mix well.
Is my example wrong?
CREATE GLOBAL TEMPORARY TABLE a AS ( SELECT * from b ) ON COMMIT PRESERVE ROWS;
it should be:
CREATE GLOBAL TEMPORARY TABLE a ON COMMIT PRESERVE ROWS AS select * from b;
(add where 1 = 0 too, if you do not want to fill it first for the current session with all the data from b).