Link to home
Start Free TrialLog in
Avatar of victory_in
victory_in

asked on

INSERT Statement by using SELECT

Hello gentlemen,

I've emp table. By using "SELECT statement, I need to create a INSERT statement for this. How do I do that?In other words I've 10 records in EMP table.I need to create INSERT statement using those values.

I need 10 insert statement becuase there is 10 records in the table. Make sense....

Thank you so much
Victor
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

INSERT INTO sometable ( col1, col2 ... )
SELECT field1, field2...
FROM emp;
>I need 10 insert statement becuase there is 10 records in the table
as you see from above suggestion, you will need 1 INSERT statement to copy all 10 records at 1 time...
ASKER CERTIFIED SOLUTION
Avatar of Sujith
Sujith
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of victory_in
victory_in

ASKER

Sujith and Nav you both are right. thanks for your help. Will share the ponits.

Thanks
--Victor