Created
September 13, 2018 22:43
-
-
Save austindoeswork/75ad3263e29165d08e2e0ae44344370b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
case when segments.confidence < 75 | |
then '< 75' | |
else '> 75' end confidance, | |
sum(time_spent_working)::float / (sum(duration)::float / 1000.0) secs_per_audio_sec | |
from segments | |
inner join calls on calls.id = segments.call_id | |
where 1=1 | |
and calls.created_at >= date_trunc('year', now()) | |
and EXTRACT(EPOCH FROM current_timestamp-calls.occurred_at)/(3600*24) between 0 and 60 | |
and calls.status = 600 | |
and segments.time_spent_working < segments.duration / 20 | |
and segments.time_spent_working IS NOT NULL | |
and segments.time_spent_working > 0 | |
group by 1 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment