Link to home
Start Free TrialLog in
Avatar of Lia Nungaray
Lia NungarayFlag for United States of America

asked on

Create Temporary table from Select statement

What would be the equivalent in Oracle for this MSSQL statement:

SELECT data1 INTO newtable FROM table1.

I haven't worked with MSSQL in a while, in this also correct?

SELECT column1 FROM table1 INTO #t1?

Thank you.
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lia Nungaray

ASKER

Thank you.
"What would be the equivalent in Oracle for this MSSQL statement:

 SELECT data1 INTO newtable FROM table1."

In Oracle, you can likely drop the "INTO newtable" part of that statement.  Oracle supports simply selecting what you want from the table(s) you want, regardless of insert, update or delete activity that may be happening in the table(s).  Oracle will give you a "read consistent" result set from the instant in time that your query was submitted.  You will only see data that was already committed at that point in time.

As others indicated, Oracle supports "global temporary tables".  In some (rare) cases, these can be helpful, but they aren't created (nor dropped) "on-the-fly" like temporary tables in SQL Server.