简体   繁体   中英

Create table #name; is throwing a syntax error

When I use the following query:

create table #name;

I get the following error:

SQL Error [42601]: ERROR: syntax error at end of input

I am doing this in RedShift DB

I also tried "create temporary table #name;" and "create temporary table name;". I am getting the same error for this query also.

I am trying to create a temporary table here, but I keep getting syntax error

use the CREATE TEMPORARY TABLE statement.

CREATE TEMPORARY TABLE #name (
    id INTEGER,
    name VARCHAR(255)
);

https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html

You must provide the table and columns name, as well as the data types that will be used in it. For Eg:

create table #name (
column_name1 data_type1,
column_name2 data_typ2
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM