Mostly developers need to transfer data from one table to another. For this purpose we have two scenarios :
One target table
is already created. second target table is not already created
So in first scenario when Target table is already created.
we can use following command :
INSERT
INTO TargetTable
(FirstName,
LastName)
SELECT
FirstName, LastName
FROM
sourceTable
WHERE
age = 21
So in first scenario when Target table is not already created.
SELECT
FirstName, LastName
INTO
TargetTable
FROM
sourceTable
WHERE
age = 21