select - 查询重复值并根据它们选择列值
解决方案
以下是查询 -
select count(*), number from <tableName> where number in (select number from <tableName> where area='three') group by number having count(*)>1;
select number from <tableName> group by number having count(*)>1 and sum(case when area='Three' then 1 else 0) = 1;
推荐阅读
- node.js - at=error code=H12 desc="Request timeout" in node.js.如何处理?
- java - 如何使用 DateTimeFormatter 仅获取时间?
- tensorflow - 在 google colab 中,有没有办法检查 TPU 版本正在运行?
- swift - 如何在附加到 TextField 的 swift @Published didSet 中正确格式化字符串?
- swiftui - 每个总是导致错误的简单结构编译器无法在合理的时间内对该表达式进行类型检查
- javascript - 使用选择框选项管理 div 滚动条
- c# - 如何在 C# 代码中访问 ExpressJS 制作的 REST API 端点
- firebase - Flutter Firebase 如何在不覆盖值的情况下更新数据?
- python - Azure Functions (python) adal 身份验证超时
- sql - 按月获取输入日期范围的数据