Home > database >  The CASE WHEN averaging
The CASE WHEN averaging

Time:09-19

 
The sum (CASE
The WHEN t.b ipcode='BIP2C094 THEN
1
The ELSE
0
The END),
The sum (CASE
The WHEN t.b ipcode='BIP2C094 THEN
1
The ELSE
0
The END),

After the two conditions the SUM in CASE the WHEN averaging how to write

CodePudding user response:

You are asked what mean?

CodePudding user response:

Demand is not very understand

CodePudding user response:

/task average confirm time * * * *
Select td. Name a unit,
Avg (case when trunc (tc reate_time, 'MM)=trunc (add_months (trunc (sysdate), 1), "MM") then ceil ((t.u pdate_time - tc reate_time) * 24 * 60) end) last month average confirm time,
Avg (case when trunc (tc reate_time, 'MM)=trunc (sysdate,' MM) then ceil ((t.u pdate_time - tc reate_time) * 24 * 60) end of this month average confirm time
The from response_task_info t
Left the join response_dept td on td. Id=t.s tart_dept
Where t.s tatus='1'
And t.o perate_status='109254'
Group by td. Name;

CodePudding user response:

(sum (CASE
The WHEN t.b ipcode='BIP2C094 THEN
1
The ELSE
0
END) +
The sum (CASE
The WHEN t.b ipcode='BIP2C094 THEN
1
The ELSE
0
END))/2,

CodePudding user response:

Digging up the grave up resin,
  • Related