How to create and invoke temp table in redshift

I want to create a temporary table and call this temporary table in redshift? I tried this one but got an error message.

select  top 10 * into #a from public.item_activity where item_act_timestamp < DATEADD(day,-1,getdate());

select * from #a

"ERROR: 42P01: relation" #a "does not exist"

+4
source share
2 answers

Create a table table using the following command:

  CREATE TEMP TABLE temp_table_name ....

Once this is done, use the select query as shown below

  select * from temp_table_name

The temporary table exists only for the duration of the session with which you created the table.

+3
source

- , , . , , Aginity , :

  • : "" > " " → " "
  • : "" → "" → " " → " " " "

Aginity, .

, - !

+1

All Articles