我的 sql 查询为给定员工返回特定周的正确结果
例如,我的员工列表是(员工1,员工2,员工3,员工4)
如果emp4在该周内未完成任何工作,则该员工的行根本不会返回。
我的疑问如下:
select a.creator_login ,
sum (case when a.activitytype = 'NCE- Installation' then a.duration else 0 end) as NCE_Installation ,
sum (case when a.activitytype = 'NCE- Migration' then a.duration else 0 end) as NCE_Migration ,
sum (case when a.activitytype = 'NCE-Circuit Testing' then a.duration else 0 end) as NCE_Circuit_Testing ,
sum (case when a.activitytype = 'NCE-Communication - External' then a.duration else 0 end) as NCE_Communication_External,
sum (case when a.activitytype = 'NCE-Communication - Internal' then a.duration else 0 end) as NCE_Communication_Internal,
sum (case when a.activitytype = 'Exception' then a.duration else 0 end) as Exception,
sum (case when a.activitytype = 'NCE-Configuration' then a.duration else 0 end) as NCE_Configuration,
sum (case when a.activitytype = 'NCE-Design Reqt Gathering' then a.duration else 0 end) as NCE_Design_Reqt_Gathering,
sum (case when a.activitytype = 'NCE-Documentation' then a.duration else 0 end) as NCE_Documentation,
sum (case when a.activitytype = 'Notes' then a.duration else 0 end) as Notes,
sum (case when b.openingcode = 'GOC Acceptance' then a.duration else 0 end) as GOC_Acceptance,
sum (case when a.activitytype = 'To Do' then a.duration else 0 end) as To_Do
from vware.snap_ticketactivities a , vware.snap_troubletickets b
where a.ticketrowid = b.ticketrowid
and a.creator_login in ('AMITTAL','HSHARMA','NKHAN','PKSINGH','PPATNANA','PTHAKUR','SDAS','SPATEL','VDASS','VVIGNESHWARAN','AOAK') and a.created between trunc(sysdate-12) and trunc(sysdate-6 )
group by a.creator_login
如果该周的员工记录仍然不存在,则员工姓名应显示为0
试试这个:
select emp_list.creator_login,
sum(case
when a.activitytype = 'NCE- Installation' then
a.duration
else
0
end) as NCE_Installation,
sum(case
when a.activitytype = 'NCE- Migration' then
a.duration
else
0
end) as NCE_Migration,
sum(case
when a.activitytype = 'NCE-Circuit Testing' then
a.duration
else
0
end) as NCE_Circuit_Testing,
sum(case
when a.activitytype = 'NCE-Communication - External' then
a.duration
else
0
end) as NCE_Communication_External,
sum(case
when a.activitytype = 'NCE-Communication - Internal' then
a.duration
else
0
end) as NCE_Communication_Internal,
sum(case
when a.activitytype = 'Exception' then
a.duration
else
0
end) as Exception,
sum(case
when a.activitytype = 'NCE-Configuration' then
a.duration
else
0
end) as NCE_Configuration,
sum(case
when a.activitytype = 'NCE-Design Reqt Gathering' then
a.duration
else
0
end) as NCE_Design_Reqt_Gathering,
sum(case
when a.activitytype = 'NCE-Documentation' then
a.duration
else
0
end) as NCE_Documentation,
sum(case
when a.activitytype = 'Notes' then
a.duration
else
0
end) as Notes,
sum(case
when b.openingcode = 'GOC Acceptance' then
a.duration
else
0
end) as GOC_Acceptance,
sum(case
when a.activitytype = 'To Do' then
a.duration
else
0
end) as To_Do
from (select 'AMITTAL' creator_login
from dual
union all
select 'HSHARMA'
from dual
union all
select 'NKHAN'
from dual
union all
select 'PKSINGH'
from dual
union all
select 'PPATNANA'
from dual
union all
select 'PTHAKUR'
from dual
union all
select 'SDAS'
from dual
union all
select 'SPATEL'
from dual
union all
select 'VDASS'
from dual
union all
select 'VVIGNESHWARAN'
from dual
union all
select 'AOAK' from dual) emp_list
left outer join vware.snap_ticketactivities a on emp_list.creator_login =
a.creator_login
inner join vware.snap_troubletickets b on a.ticketrowid = b.ticketrowid
where nvl(a.created, trunc(sysdate - 12)) between trunc(sysdate - 12) and
trunc(sysdate - 6)
group by emp_list.creator_login;
我用的是Selenium ChromeDriver v2.40,Chrome版本67。 上面两个findelement都可以,可以获取值,但不能点击,因为元素不可见。 所以我继续尝试预期条件,没有运气: 上面的代码返回: 它与Chromev67有任何向后兼容问题吗?
我有以下PHP代码。我希望返回插入的最后一个id: 我的DB架构如下: 我已经把厨房的水槽扔过去了,但一点也没有。无论我做什么,总是未定义的。我已经验证了实际上有一个插入。我只剩下运行另一个select并返回最大VesselTransitID的(可怕的)选项,这并不能保证正确的结果。
我在一次采访中被问到: 给定下属和经理,构造一个数据结构(或使用现有的数据结构),然后实现方法,以便它打印总的直接和间接报告。 我告诉我,我将通过构建一个图来解决它,然后计算每个顶点的in度,我告诉它时间复杂度为O(ve)。然后我被要求用计算机解决这个问题
问题内容: 我正在尝试使用getElementById()获取元素,但是即使元素存在,它也会返回null。我究竟做错了什么? 问题答案: 您必须将其放在一个 事件中。脚本执行时尚未到达DOM 。
问题内容: 我当前正在编写一个脚本,该脚本必须检查所有指定的文件夹是否实际存在。我发现我必须将os.path.isdir()与绝对路径一起使用。 我有以下目录结构: 当我打开op我的python命令行并尝试文件夹是否确实存在时,我得到以下信息: 这很奇怪,因为当我将这些路径复制并粘贴到Windows资源管理器中时,我可以毫无问题地访问它们。我检查了权限,所有文件夹都具有相同的权限。有人知道我在做什
本文向大家介绍使用Python在给定时间内工作的程序员数量,包括了使用Python在给定时间内工作的程序员数量的使用技巧和注意事项,需要的朋友参考一下 假设我们有间隔列表和另一个输入时间。在每个时间间隔中,结构都是[start,end],它表示程序员工作的时间。我们必须找到当时正在工作的程序员数量。 因此,如果输入像interval = [[2,6],[4,10],[5,9],[11,14]],t