Create table from select in Oracle

IAdapter picture IAdapter · Dec 21, 2011 · Viewed 7.2k times · Source

I would like to do something like this:

create table NEW_TABLE (select * from OLD_TABLE where id=3582)

And have a new table created from the resulting columns of that select statement.

I bet its possible in mySQL, but how to do it in Oracle?

Answer

Telmo Marques picture Telmo Marques · Dec 21, 2011

Try this:

CREATE TABLE new_table AS select * from OLD_TABLE where id=3582