How to Insert Data Fetched from another Table in SQL
In this article I am going to explain how to insert data fetched from another table in SQL.
In this article I am going to explain how to insert data fetched from another table in SQL. We can insert data into a table fetched from one or more other table in SQL. To insert this type of data we use subquery.
We right sub query in insert statement at the place of values. Result derived from subquery works as input or inserted value.
Statement that create a table
create table mcntemp
invoiceid int not null,
vendorid int not null,
Statement that insert data in Table
INSERT INTO mcntemp
SELECT * FROM dbo.mcninvoices
Statement show data in mcntemp table