Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Copying the structure
<pankaj_wolfhunter_at_yahoo.co.in> a écrit dans le message de news: 1145940718.499857.315340_at_t31g2000cwb.googlegroups.com...
| Greetings,
| I have a table as
| table1
| ID INTEGER
| NAME VARCHAR2(50)
| DOJ TIMESTAMP
| .....
|
| I want to create another table (table2) with the same structure as
| table1 but the DOJ
| datatype has to be changed to NUMBER(5,4)
|
| table2
| ID INTEGER
| NAME VARCHAR2(50)
| DOJ NUMBER(5,4)
| ....
|
| Can I do it in single select statement? Something related to
|
| CREATE TABLE table2 AS SELECT * FROM table1 WHERE 1=0;
|
| Any help would be appreciated?
|
| TIA
|
something like:
CTAS select id, name, to_number(to_char(doj,'DDD')) doj from table1 where 1=0;
Regards
Michel Cadot
Received on Tue Apr 25 2006 - 00:14:28 CDT