将子查询的结果写入表的问题
我想从Course,Class,Teacher表中查询数据Student_id,course_id,course_year,Teacher_id然后插入Student_course表中,怎么实现?下面是我在程序中用到的Sql字符串,有错误,请大家帮忙指点哈.string st_sqlstr = "insert into Student_course(Student_id,Course_year,Course_id,Teacher_id) (select Student_id,@Cours_id,@Cours_year @Teach_id from Student,Teacher where Student_class_id=@Clas_id) ";