当前位置:Gxlcms > 数据库问题 > MySQL数据库:合并结果集

MySQL数据库:合并结果集

时间:2021-07-01 10:21:17 帮助过:28人阅读

合并结果集

union----合并结果集

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

MySQL数据库:合并结果集

标签:mys   select   去重   使用   union all   pre   sel   重复   teacher   

人气教程排行