Skip to content

Instantly share code, notes, and snippets.

@meanother
Created October 14, 2021 19:23
Show Gist options
  • Save meanother/5d4552ff76596332828a251fad2b27a0 to your computer and use it in GitHub Desktop.
Save meanother/5d4552ff76596332828a251fad2b27a0 to your computer and use it in GitHub Desktop.
select
round(
avg(date_part('day', bank_answer_date-create_dt)::int), 1
) as "Среднее время ответа в днях"
, round(
median(date_part('day', bank_answer_date-create_dt)::int), 1
) as "Медианное время ответа в днях"
from
home.dt_banki_responses
where
date(create_dt) >= '2021-01-01'
and status in ('Проблема решена', 'Зачтено')
and bank_answer_date is not null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment