Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL help (create table)

Re: SQL help (create table)

From: Bricklen Anderson <bricklen_at_shaw.ca>
Date: Mon, 03 Jun 2002 15:11:23 GMT
Message-ID: <3CFB8620.2D46D43B@shaw.ca>


just to add to that, you will also get any content of the table that you are creating from. To get just the structure, write it like this: CREATE TABLE new_table_1 AS
SELECT col_1, col_2 FROM wxisting_table
WHERE 1=0; -- this is just a quick way of making it impossible to get the data also

Pieter wrote:
>
> CREATE TABLE new_table_1 AS
> SELECT col_1, col_2 FROM wxisting_table;
>
> The new columns inherit the data type
>
> Jean-Baptiste Jacquemard wrote:
>
> > Hello
> > I'd like to know if it is possible to create a table where column names are the result of a select.
> > Something like : create table new_table (select column from table)
> > And if yes, how do I specify data types ? Is there a default data type ?
> > Thanks a lot
> >
> >
>
> --
> Remove '-123' (no quotes) from the e-mail address when you want to reply
> to me
>
> -Happy Trails ;-)
Received on Mon Jun 03 2002 - 10:11:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US