Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Inserting into a table

Author  Topic 

akpbond007
Starting Member

5 Posts

Posted - 2010-06-17 : 13:09:01
Hi I want to insert a calculated values of data into another table.
I'm getting an syntax error.

My query is

Insert into table1(Rollno,Marks) value(select Rollno,sum(Marks) from table2 group by Rollno)

Please help me

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-06-17 : 13:35:06
Its just
Insert into table1(Rollno,Marks)
select Rollno,sum(Marks) from table2 group by Rollno

Go to Top of Page
   

- Advertisement -