项目1:查找重复的电子邮箱
创建 email表,并插入如下三行数据
-- 创建表
CREATE TABLE email( id INT NOT NULL auto_increment, email VARCHAR(20) NOT NULL, PRIMARY KEY(id));
-- 插入数据
INSERT into email(email) VALUES ("a123@.com"), ("b123@.com"), ("a123@.com"), ("d123@.com");
---查找重复的电子邮箱:
SELECT email FROM email GROUP BY email HAVING COUNT(email)>1;