---
title: "my sql union"
author: "kidd"
date: "2011-12-29T11:43:56Z"
tags: []
categories: ["数据库"]
slug: "my-sql-union"
draft: false
lastmod: "2011-12-29T11:43:56Z"
id: 1329294
url: "https://kidd.iteye.com/blog/1329294"
---

```
select a.column from table a where a.column!='value' group by a.column 
union all select b.column from table b where b.column='value' group by b.column 
```