SELECT
t.id AS transaction_id,
t.operation_id,
t.value AS transaction_value,
t.debit_account_id,
dat.mnemonics AS debit_account_type,
da.owner_sharer_id AS debit_owner_sharer_id,
t.credit_account_id,
cat.mnemonics AS credit_account_type,
ca.owner_sharer_id AS credit_owner_sharer_id
FROM back_office."transaction" t
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
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
WHERE t.operation_id = 84319200
ORDER BY t.id;