Insert Data Into Table Sql. The insert into table statement is the one we ll use to solve this problem. If you are adding values for all the columns of the table you do not need to specify the column names in the sql query.
In this syntax you use a select which is called a subselect instead of the values clause. Insert into table1 column1 column2 select column1 column2 from table2 where condition1. If you are adding values for all the columns of the table you do not need to specify the column names in the sql query.
Here column1 column2 column3 columnn are the names of the columns in the table into which you want to insert the data.
Second a comma separated list of columns in the table surrounded by parentheses. The first way specifies both the column names and the values to be inserted. Here column1 column2 column3 columnn are the names of the columns in the table into which you want to insert the data. The insert into select statement copies data from one table and inserts it into another table.