Remove Duplicates from Table
2016-04-07 19:29
645 查看
Remove Duplicates from Table
[Description]
You are give a table named Person
Code: Select
all
[Description] You are give a table named Person Code: Select all +-------------+---------+ | Column Name | Type | +-------------+---------+ | email | varchar | | id | int | +-------------+---------+ id is the primary key column for this table. Write a SQL to delete all the duplicated email records
id is the primary key column for this table.
Write a SQL to delete all the duplicated email records
For example, if the rows are:
For example, if the rows are: +----+-------------+ | 1 | a@gmail.com | | 2 | b@gmail.com | | 3 | a@gmail.com | | 4 | b@gmail.com | +----+-------------+ Does deleting duplicate email records mean deleting all duplicates except the first entry? +----+-------------+ | 1 | a@gmail.com | | 2 | b@gmail.com | +----+-------------+ Or we don't care if the deleted entry is not the first one, such as this is correct too? +----+-------------+ | 3 | a@gmail.com | | 4 | b@gmail.com | +----+-------------+
相关文章推荐
- Android之获取手机上的图片和视频缩略图thumbnails
- 数据库链接字符串查询网站
- DB2实例管理
- DB2实例管理
- 保障MySQL数据安全的14个最佳方法
- mysql问答汇集
- 第三章 数据库备份和还原
- 创建一个空的IBM DB2 ECO数据库的方法
- Access 2000 数据库 80 万记录通用快速分页类
- 开通一个数据库失败的原因的和解决办法
- 一个简单的asp数据库操作类
- CentOS下DB2数据库安装过程详解
- EasyASP v1.5发布(包含数据库操作类,原clsDbCtrl.asp)第1/2页
- sql2008 还原数据库解决方案
- Oracle 数据库自动存储管理-安装配置
- Oracle数据库执行脚本常用命令小结
- Oracle 数据库 临时数据的处理方法
- 数据库分页查询语句数据库查询
- 最近比较流行的数据库挂马