sql - 需要帮助列出责任名称中的重复功能
问题描述
我需要在 Oracle 的职责名称中列出重复的功能
我试过下面的 sql 查询
select ffl.user_function_name, ff.function_name, rtl.responsibility_name
from apps.fnd_form_functions ff,
apps.fnd_form_functions_tl ffl,
apps.fnd_responsibility_vl rtl,
apps.fnd_responsibility r,
apps.fnd_compiled_menu_functions cmf
where cmf.function_id = ff.function_id
and r.menu_id = cmf.menu_id
and rtl.responsibility_id = r.responsibility_id
and cmf.grant_flag = 'Y'
and ff.function_id = ffl.function_id
and ffl.user_function_name = ffl.user_function_name
and rtl.responsibility_name like "responsibility name"
and ffl.language = 'US'
order by ffl.user_function_name;
我预计 sql 结果将是责任名称中唯一具有 value 的重复函数responsibility name
。
解决方案
你需要一个group by
withhaving count(*) > 1
子句
select ffl.user_function_name, ff.function_name, rtl.responsibility_name
from apps.fnd_form_functions ff
join apps.fnd_form_functions_tl ffl on ffl.function_id = ff.function_id
join apps.fnd_compiled_menu_functions cmf on cmf.function_id = ff.function_id
join apps.fnd_responsibility r on r.menu_id = cmf.menu_id
join apps.fnd_responsibility_vl rtl on rtl.responsibility_id = r.responsibility_id
where cmf.grant_flag = 'Y'
and ffl.user_function_name = ffl.user_function_name
and rtl.responsibility_name = 'responsibility name'
and ffl.language = 'US'
group by ffl.user_function_name, ff.function_name, rtl.responsibility_name
having count(*) > 1
order by ffl.user_function_name
并继续使用ANSI-92
SQL 标准。
推荐阅读
- python - int() 是独立函数还是实际上是 int 类的 _init_ 构造函数方法?
- azure - 关于表单识别器、OCR 和 labeltool 容器的容器
- python - 如何在 django 的自定义用户模型中创建超级用户?
- visual-studio-code - 无法更改 vscode python 解释器以离开虚拟环境
- data-structures - 性能最好的通用数据结构是什么?
- routes - ASP.NET Core 3.1 MVC:路由不适用于区域
- sql - 为什么其中一个 SQL 查询有效,而另一个无效?
- java - Google Cloud App Engine - Eclipse 在 app.yaml 中显示“运行时:java 11”不是 Java
- html - 打印时如何覆盖 flex-xs 断点?
- docusignapi - 向 DocuSign Connect 和 API 日志添加更多详细信息