MySQL数据库:合并结果集

合并结果集

union----合并结果集

对合并后的结果集中的重复数据也会自动去重
select sName from students
union
select tName from Teachers;
如果不想去重 则使用 union all
select sName from students
union all
select tName from Teachers;

猜你喜欢

转载自www.cnblogs.com/yanlzy/p/11909159.html