问题
I'm trying a simple SQL select into statement on teradata tables, and following the syntax I found here. The statement is the following:
select * into DBNAME.account_backup from DBNAME.account;
When I run this code I get the following error:
SELECT Failed. 3706: Syntax error: INTO clause is not allowed
The two tables have precisely the same format (I copied the SQL which created the first table and pasted it to create the second, changing only the name).
Any ideas?
Much gratitude
回答1:
SELECT INTO
is SQL Server syntax, in Standard SQL syntax it's only used in Stored Procedure to put the result of a query returning a single row into a variable.
This is an equivalent query in Teradata:
create table DBNAME.account_backup as DBNAME.account with data;
来源:https://stackoverflow.com/questions/29977712/into-clause-is-not-allowed-error