mysql 查询信息工程学院和艺术设计学院学生的学号、姓名和家庭地址。
时间: 2024-02-22 20:59:55 浏览: 94
假设你有两个表,一个是`information_engineering`,另一个是`art_design`,它们都包含学生的学号、姓名和家庭地址。你可以使用如下的 SQL 语句来查询这些信息:
```sql
SELECT 学号, 姓名, 家庭地址 FROM information_engineering
UNION
SELECT 学号, 姓名, 家庭地址 FROM art_design;
```
这个查询语句使用了 UNION 操作符来把两个表中的结果合并在一起,然后使用 SELECT 语句选择需要的列。
阅读全文
相关推荐
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044901.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)