手记

合并多个查询结果中的数据

select couname,couno
from Course
union all
select state,couno
from StuCou
order by CouNo

select couname,couno into coursestate
from Course
union
select state,couno
from StuCou
order by CouNo

select*from coursestate

drop table coursestate

--查询学生表的学生姓名,班级表的班级名称,将结果合并到classstudent表
select stuname,classno into classstudent
from Student
union
select Classname,classno
from Class
order by ClassNo

select *from classstudent

1人推荐
随时随地看视频
慕课网APP