Tuesday, June 17, 2008

SQL Server create table as Syntax Oracle

SQL server syntax for creating a table from a query

select * into new_table from
(select col1, col2 from old_tab1,old_tab2 where 1=1) a

Keep in mind that the alias needs to be specified. SQL Server is not that forgiving.

I find the Oracle syntax much intuitive:
create table new_table
select * from ....

No comments: