打印报表以显示具有给定责任的用户-FNDSCRUR责任用户
2016-03-01 09:04
225 查看
select --&p_hint
distinct
user_name,
decode (
greatest (u.start_date,
ur.start_date,
r.start_date,
to_date ('1000-01-01', 'YYYY-MM-DD')),
to_date ('1000-01-01', 'YYYY-MM-DD'), '',
to_char (greatest (u.start_date, ur.start_date, r.start_date)))
resp_start_date,
decode (
least (nvl (u.end_date, to_date ('4712-01-01', 'YYYY-MM-DD')),
nvl (ur.end_date, to_date ('4712-01-01', 'YYYY-MM-DD')),
nvl (r.end_date, to_date ('4712-01-01', 'YYYY-MM-DD'))),
to_date ('4712-01-01', 'YYYY-MM-DD'), '',
to_char (
least (nvl (u.end_date, nvl (ur.end_date, r.end_date)),
nvl (ur.end_date, nvl (u.end_date, r.end_date)),
nvl (r.end_date, nvl (u.end_date, ur.end_date)))))
resp_end_date,
s.security_group_name
-- , u.description
, rt.responsibility_name,
rt.description
from fnd_user u,
fnd_user_resp_groups_all ur,
fnd_responsibility r,
fnd_security_groups_vl s,
fnd_responsibility_tl rt
where 1 = 1
and rt.responsibility_id = r.responsibility_id
and rt.application_id = r.application_id
--AND r.application_id = :application_id
-- and r.responsibility_id = :responsibility_id
and user_name = 'QUANWEIRU'
and ur.responsibility_application_id = r.application_id
and ur.responsibility_id = r.responsibility_id
and u.user_id = ur.user_id
and ur.security_group_id = s.security_group_id
order by user_name, security_group_name
distinct
user_name,
decode (
greatest (u.start_date,
ur.start_date,
r.start_date,
to_date ('1000-01-01', 'YYYY-MM-DD')),
to_date ('1000-01-01', 'YYYY-MM-DD'), '',
to_char (greatest (u.start_date, ur.start_date, r.start_date)))
resp_start_date,
decode (
least (nvl (u.end_date, to_date ('4712-01-01', 'YYYY-MM-DD')),
nvl (ur.end_date, to_date ('4712-01-01', 'YYYY-MM-DD')),
nvl (r.end_date, to_date ('4712-01-01', 'YYYY-MM-DD'))),
to_date ('4712-01-01', 'YYYY-MM-DD'), '',
to_char (
least (nvl (u.end_date, nvl (ur.end_date, r.end_date)),
nvl (ur.end_date, nvl (u.end_date, r.end_date)),
nvl (r.end_date, nvl (u.end_date, ur.end_date)))))
resp_end_date,
s.security_group_name
-- , u.description
, rt.responsibility_name,
rt.description
from fnd_user u,
fnd_user_resp_groups_all ur,
fnd_responsibility r,
fnd_security_groups_vl s,
fnd_responsibility_tl rt
where 1 = 1
and rt.responsibility_id = r.responsibility_id
and rt.application_id = r.application_id
--AND r.application_id = :application_id
-- and r.responsibility_id = :responsibility_id
and user_name = 'QUANWEIRU'
and ur.responsibility_application_id = r.application_id
and ur.responsibility_id = r.responsibility_id
and u.user_id = ur.user_id
and ur.security_group_id = s.security_group_id
order by user_name, security_group_name
相关文章推荐
- Verilog代码规范I
- 虚拟架构就绪 | 谈谈Windows Server 2012 R2迁移这件小事
- Linux shell脚本编程(一)
- Set-DnsServerGlobalQueryBlockList
- 网关的通俗讲解(转)
- [oracle] ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务 的解决方法
- JS 隔行换色,checkbox选中换色,checkbox全选
- spring 配置hibernate映射文件的两种方法
- Android 实现Toast的快速切换刷新
- SQLite 批量insert - 如何加速SQLite的插入操作
- Django:locals()小技巧
- PB如何实现动态建立菜单
- 同步、异步读取股票行情(源代码)
- 嵌套回调异步与$.Deferred异步
- 微信支付之HTML5页面WAP端接入
- PB中实现菜单的动态生成(函数递归实现)
- activity之栈管理
- 容器
- 使用OpenCV合成两张图片
- LaTeX画图相关