Inserting Data into MySQL Database using SQL

Feedback


Solution 1:

The values keyword is not utilized by Mysql.

Insert into table_a (field1, field2)
 Select field1, field2 from table_b where table_b.ID = 10;


Solution 2:

In oracle and mysql:

insert into test 
select 1 from dual

The phrase “insert into table values” should not be used.

Frequently Asked Questions

Posted in Sql