0

Hi I want to insert a table values from the same table is it possible?

Ex : I'm trying to insert like this

insert into emplyeee values (select # * from employee)

Thanks in advance

2 Answers 2

3

leave out the value keyword:

insert into employee select * from employee 

Assuming there are no unique or primary key constraints of course.

Sign up to request clarification or add additional context in comments.

Comments

2

Yes you can:

insert into employee (Column1,Column2,Column3) select Column1,Column2,Column3 from employee 

You should specify all the non-identity columns if you have an identity field, as you will not be allowed to insert the identity values explicitly.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.