SQL: copy a table into another...

Solved
Nico -  
 necroma -
Hello everyone,

The query:
CREATE TABLE TABLE2 AS SELECT * FROM TABLE1 ;
allows me to copy the structure as well as the data from TABLE1 into TABLE2.
Is there a way (query) to copy only the structure (without the data)?

Thank you all for your help.

9 answers

Lio
 
Even cleaner:

CREATE TABLE table2 LIKE table1

(Simply copies the structure of table1 by creating table2)
40
Martin
 
Even less on Oracle
0
mtk30
 
encore moi sur PGsql 9.3
0