浏览模式: 普通 | 列表
4月, 2020 | 1
问题:mysql语句中union和union all 的区别
答案:union会过滤掉两个结果集中重复的行,而union all不会过滤掉重复行。

注意事项:union不能与order by 合用,需要在数组中重新排序下

范例:
SELECT aid,title FROM article UNION ALL SELECT bid,title FROM blog
1