请教一个sql的问题。想把select结果插入insert语句应该怎么做?(代码如下…想把mytcno插进去。多谢!
selectc.teachCourseNoasmytcnofromCoursea,TeachCourseb,SelectCoursecwherea.courseNo=b....
select c.teachCourseNo as mytcno from Course a,TeachCourse b,SelectCourse c where a.courseNo=b.courseNo and b.teachCourseNo=c.teachCourseNo and a.courseName='高等数学' and c.studentNo='103401'
insert into SelectCourse(studentNo,teachCourseNo,grade) values ('103401',mytcno,99) 展开
insert into SelectCourse(studentNo,teachCourseNo,grade) values ('103401',mytcno,99) 展开
展开全部
insert into SelectCourse(studentNo, teachCourseNo, grade)
select c.studentNo, c.teachCourseNo as mytcno, 99
from Course a
join TeachCourse b on a.courseNo=b.courseNo
join SelectCourse c 念歼汪on b.teachCourseNo=c.teachCourseNo
where 1=1
and a.courseName='高仔仔等数学'改野
and c.studentNo='103401'
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
insert 碧模差into 码则表悔皮名(studentNo,teachCourseNo,grade) select c.teachCourseNo as mytcno from Course a,TeachCourse b,SelectCourse
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
insert into SelectCourse(studentNo,teachCourseNo,grade)
select 念歼汪'103401',c.teachCourseNo as mytcno,99 from Course a,TeachCourse b,SelectCourse c where a.courseNo=b.courseNo and b.teachCourseNo=c.teachCourseNo and a.courseName='高仔仔等数改野学' and c.studentNo='103401'
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询