SELECT Email
FROM Person
GROUP BY Email
HAVING count(id)>=2
1.3 运行截图
2 每个产品在不同商店的价格
2.1 题目内容
2.1.1 基本题目信息
2.1.2 示例输入输出
2.2 示例sql语句
# 多行数据抽离出来可以考虑使用union或者union all,union all是包含重复行的
# 因为本题不可能存在重复行,所以UION ALL 和union是都可以的,但是这两个关键字要求取名必须一样的
SELECT product_id,"store1" store,store1 price
FROM Products
WHERE store1 IS NOT NULL
UNION ALL
SELECT product_id,"store2" store,store2 price
FROM Products
WHERE store2 IS NOT NULL
UNION ALL
SELECT product_id,"store3" store,store3 price
FROM Products
WHERE store3 IS NOT NULL
2.3 运行截图
3 计算特殊奖金
3.1 题目内容
3.1.1 基本题目信息
3.1.2 示例输入输出
3.2 示例sql语句
SELECT employee_id,IF(MOD(employee_id,2)=1 AND name NOT LIKE 'M%',salary,0) bonus
FROM Employees
ORDER BY employee_id asc