Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create table from select in Oracle

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?

like image 285
IAdapter Avatar asked Jan 19 '23 00:01

IAdapter


1 Answers

Try this:

CREATE TABLE new_table AS select * from OLD_TABLE where id=3582
like image 87
Telmo Marques Avatar answered Jan 21 '23 04:01

Telmo Marques