Duplicate Emails
来源:互联网 发布:吉利知豆d2说明书 编辑:程序博客网 时间:2024/04/29 04:56
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Email | +----+---------+ | 1 | a@b.com | | 2 | c@d.com | | 3 | a@b.com | +----+---------+ For example, your query should return the following for the above table: +---------+ | Email | +---------+ | a@b.com | +---------+Note: All emails are in lowercase. 主要是group by的应用 select Email from ( select Email,count(Email) as cnt from Person group by Email ) t where cnt>1; 或者 select Email from ( select Email,count(Email) as cnt from Person group by Email having cnt>1) t ; order by 要在group by 之后使用,不能在group by之前使用。 select Email from ( select Email,count(Email) as cnt from Person order by Email group by Email ) t where cnt>1; 这个执行会有问题。
0 0
- Duplicate Emails
- Duplicate Emails
- Duplicate Emails
- Duplicate Emails
- Duplicate Emails
- Duplicate Emails
- Duplicate Emails Leetcode SQL
- [LeetCode][Database]Duplicate Emails
- LeetCode OJ Duplicate Emails
- LeetCode Delete Duplicate Emails
- Delete Duplicate Emails
- 【Leetcode Database】Duplicate Emails
- Duplicate Emails LeetCode
- Delete Duplicate Emails LeetCode
- Leetcode: Duplicate Emails
- Leetcode Delete Duplicate Emails
- Delete Duplicate Emails
- 【leetcode】 database Duplicate Emails
- 系统入门(11):Android4.0窗口机制和创建过程分析
- 服务器用U盘虚拟光驱装系统,有做RAID5,加载RAID驱动成功后,安装到最后会报“windows无法确定此计算机是否包含有效系统卷”错误
- 黑马程序员——Java基础——多线程(一)
- ubuntu php lamp环境搭建
- sql 语句 二
- Duplicate Emails
- ccna的Stp协议
- English Contest -- My English History
- storyboard 中coredata 出现问题:addPersistentStoreWithType 程序崩溃 后面还会跟着一串数据库地址,
- 【MAC使用技巧】黑苹果插入耳机之后依旧是外音
- 欧拉工程第25题:1000-digit Fibonacci number
- java.sql.SQLException: Access denied for user 'sa'@'localhost' (using password: NO)
- 进程与线程
- 年月日输入正确的判断与转换格式,第三章第36题