# select 所需信息 from 表1unionselect 所需信息 from 表2 select*from teacher ; select*from student ; # 合并student 和teacher表并显示姓名列,注意不显示重复数据!! select name from teacher unionselect name from student;
# 导入student表格,从teacher和student表中找出全部男性的name,并按字母排序 source ~/Desktop/student.sql 表elect name from teacher unionallselect name from student orderby1; # 导出数据 /usr/local/mysql/bin/mysqldump -uroot -proot websafe >~/Desktop/a.sql