---
title: "mysql的union和union all"
author: "brilon"
date: "2009-07-24T14:15:26Z"
tags: []
slug: "mysql-union-union-all"
draft: false
lastmod: "2009-07-27T09:57:58Z"
id: 432313
url: "https://brilon.iteye.com/blog/432313"
---

效率上,union all比union更好一点.因为union在执行的时候会把结果集进行排序并删除重复的记录,而union all则会把两个结果集原封不动地合并在一起.