I have a table books
, I want to create table Book101
and then copy the contents of table books
into it.
Asked
Active
Viewed 305 times
0
-
I am puzzled by the differing requirement in the title and question - to copy or not to copy? – P.Salmon Jan 09 '21 at 08:13
1 Answers
0
CREATE TABLE Book101 AS SELECT * FROM books WHERE 1=0;
Above example will create only structure.
If you want to Clone the table with structure and data both then you can you below one:
CREATE TABLE Book101 AS SELECT * FROM books;

Owen Kelvin
- 14,054
- 10
- 41
- 74

anand.malvi
- 24
- 1