-1

While creating a backup of a table, I am using the following Syntax -

CREATE TABLE new_table LIKE original_table;
INSERT new_table SELECT * FROM original_table;

But while executing the first Statement only, I am getting the folowing error:

SQL-Fehler: ORA-00922: Fehlende oder ungültige Option 00922. 00000 - "missing or invalid option"

I am new to SQL but this should be simple execution.

3
  • Are you using MySQL or Oracle? Commented Mar 22, 2019 at 8:09
  • I am using Oracle. Commented Mar 22, 2019 at 8:10
  • That's an Oracle error I don't know that mysql has this option Commented Mar 22, 2019 at 8:10

1 Answer 1

0

In oracle you should use CREATE AS select

CREATE TABLE new_table 
AS SELECT * FROM original_table

in mysql CREATE SELECT

CREATE TABLE new_table 
SELECT * FROM original_table
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.