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


select
    t.id as transaction_id,
    o.id as operation_id,
    t.effective_date,
    t.value,
    ot.code as operation_code,
    dat.mnemonics as debit_type,
    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 ourpension.sharer s
join back_office.account da
    on da.owner_sharer_id = s.id
join back_office.transaction t
    on t.debit_account_id = da.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 dat
    on dat.id = da.account_type_id
left join back_office.account ca
    on ca.id = t.credit_account_id
left 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
where s.number like '%02688346889'
    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;