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


select
    t.id as transaction_id,
    t.effective_date,
    t.value,
    ot.code as operation_code,
    dat.mnemonics as debit_type,
    da.owner_sharer_id as debit_sharer_id,
    cat.mnemonics as credit_type,
    catg.mnemonics as credit_group,
    o.approved is not null as is_approved,
    o.deleted is not null as is_deleted
from back_office.account ca
join back_office.transaction t
    on t.credit_account_id = ca.id
join back_office.operation o
    on o.id = t.operation_id
join back_office.operation_type ot
    on ot.id = o.operation_type_id
join back_office.account_type cat
    on cat.id = ca.account_type_id
left join back_office.account_type_group catg
    on catg.id = cat.account_type_group_id
left join back_office.account da
    on da.id = t.debit_account_id
left join back_office.account_type dat
    on dat.id = da.account_type_id
where ca.owner_sharer_id = 14280820
    and t.effective_date >= cast('2026-08-01' as date)
    and t.effective_date < cast('2026-10-01' as date)
order by t.effective_date, t.id;