oracle – T-SQL:如何用SELECT创建表?

前端之家收集整理的这篇文章主要介绍了oracle – T-SQL:如何用SELECT创建表?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在oracle中,您可以发出:
create table foo as select * from bar;

什么是等效的T-sql语句?

您可以使用 SELECT INTO.从MSDN:

The SELECT INTO statement creates a new table and populates it with
the result set of the SELECT statement. SELECT INTO can be used to
combine data from several tables or views into one table. It can also
be used to create a new table that contains data selected from a
linked server.

所以:

SELECT col1,col2,col3 INTO newTable FROM existingTable;

猜你在找的Oracle相关文章