---
title: "重复数据处理"
author: "elihe2011"
date: "2013-02-26T15:11:06Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2013-02-26T15:11:06Z"
id: 1815318
url: "https://elihe2011.iteye.com/blog/1815318"
---

```
--重复数据只显示一条
select min(a) a, b, c from test_tb group by b, c;

--删除重复数据
delete from tb where rowid not in (select min(rowid) from test_tb group by b, c);

group by 查询列只能用聚集函数或被group by的字段 
```