Загрузка данных


SELECT
    o.operation_type_id,
    ot.short_name,
    count(*) AS cnt,
    min(o.effective_date) AS min_date,
    max(o.effective_date) AS max_date
FROM back_office.operation o
JOIN back_office.operation_type ot
    ON ot.id = o.operation_type_id
WHERE o.operation_type_id IN (35, 37, 112, 173)
  AND o.effective_date >= DATE '2026-08-17'
  AND o.effective_date < DATE '2026-09-08'
GROUP BY
    o.operation_type_id,
    ot.short_name
ORDER BY o.operation_type_id;




SELECT
    o.operation_type_id,
    ot.short_name,
    count(*) AS cnt,
    min(o.effective_date) AS min_date,
    max(o.effective_date) AS max_date
FROM back_office.operation o
JOIN back_office.operation_type ot
    ON ot.id = o.operation_type_id
WHERE o.effective_date >= DATE '2026-08-17'
  AND o.effective_date < DATE '2026-09-08'
  AND (
       ot.short_name ILIKE '%единоврем%'
       OR ot.short_name ILIKE '%выплат%'
  )
GROUP BY
    o.operation_type_id,
    ot.short_name
ORDER BY
    o.operation_type_id;