---
title: "mysql 根据某个字段去掉重复的记录"
author: "xiaomogui"
date: "2009-12-01T23:29:14Z"
tags: []
slug: "mysql"
draft: false
lastmod: "2009-12-01T23:29:14Z"
id: 538642
url: "https://xiaomogui.iteye.com/blog/538642"
---

数据格式如图所示.

假如每个年龄我们只取一条记录。

select \*, count(distinct age) from person group by age