Loading

MySQL UNION 操作符用于连接两个以上的 SELECT 语句的结果组合到一个结果集合中

union 会删除重复数据

union all 不会删除重复数据

select * from 
(
select *,'a' as kind from tablea where name is not null 
union all 
select *, 'b' as kind from tableb where name = 'b-data'
) a

MySQL UNION 操作符

posted @ 2021-07-26 18:18  myEsn2E9  阅读(56)  评论(0编辑  收藏  举报