sql - ORA-00936: 缺少表达式(为超过 2 个属性工作的员工的姓名)
问题描述
我不确定我缺少什么表情,
select first_name from employee
where Employee_ID in
(select Employee_ID from service
where Property_ID having count(*)>2);
解决方案
根据标题,您正在尝试编写:
select e.first_name
from employee e
group by e.Employee_ID, e.first_name
having count(distinct Property_ID) > 2;
您没有解释数据的结构,但您可以使用having count(*) > 2
.
推荐阅读
- c++ - 为什么我在赋值后得到不同的指针值?
- javascript - 在 componentDidMount() 中重新加载脚本
- android - 在可绘制文件夹中添加的普通图像不会在三星设备中显示 - Android
- spring - 禁用 RestTemplate 转义
- robotframework - 了解如何在 Robot Framework 中编写测试数据
- asp.net-core - 在没有 Visual Studio 的情况下使用 Kestrel 运行 ASP.NET Core 项目
- css - css 表与 bootstrap 不一致
- python - 如何在python中的pandas中添加缺少值的列
- html - 如何在 div 或 span 中制作无单词空间的单词,以便所有单词都以 div 宽度显示
- spring-boot - 部署新版本应用程序时向 yaml 文件添加新属性的最佳方法