Wednesday, March 28, 2012

How to insert data from another table

I want to Insert data from another table, I use the statement:
insert into YearsClass (Years,Class) (Select distinct Years, ClassID from
St)
but it fail.
How can I do?insert into YearsClass (Years,Class)
Select distinct Years, ClassID from
St
http://sqlservercode.blogspot.com/
"ad" wrote:
> I want to Insert data from another table, I use the statement:
> insert into YearsClass (Years,Class) (Select distinct Years, ClassID from
> St)
> but it fail.
> How can I do?
>
>|||Do this
insert into YearsClass (Years,Class) Select distinct Years, ClassID
from
St
ad wrote:
> I want to Insert data from another table, I use the statement:
> insert into YearsClass (Years,Class) (Select distinct Years, ClassID from
> St)
> but it fail.
> How can I do?

No comments:

Post a Comment