mysql语句中union和union all 的区别,合并查询结果集
[ 2020-04-14 13:32:16 | 作者: admin ]
问题:mysql语句中union和union all 的区别
答案:union会过滤掉两个结果集中重复的行,而union all不会过滤掉重复行。
注意事项:union不能与order by 合用,需要在数组中重新排序下
范例:
答案:union会过滤掉两个结果集中重复的行,而union all不会过滤掉重复行。
注意事项:union不能与order by 合用,需要在数组中重新排序下
范例:
SELECT aid,title FROM article UNION ALL SELECT bid,title FROM blog
1