INTO clause is not allowed error

自闭症网瘾萝莉.ら 提交于 2019-12-11 12:29:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!