网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 生活知识 知识问答

如何在sqlserver中使用union查询联合数据

时间:2026-02-15 14:30:57

1、打开sqlserver管理器,菜单栏上的“新建查询”按钮

如何在sqlserver中使用union查询联合数据

2、在查询框中输入:

select kechenghao,kechengming from 课程表

 union 

select xuehao,xingming  from 学生表

如何在sqlserver中使用union查询联合数据

3、两个表中的列数需要一致,点击菜单上的“执行”按钮

如何在sqlserver中使用union查询联合数据

© 2026 智德知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com