Advertisement
tduganov

Untitled

Apr 22nd, 2021
1,899
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT transaction_history.account_id,
  2.  
  3.            transaction_history.amount,
  4.  
  5.            transaction_history.amount_national,
  6.  
  7.            transaction_history.budget_code,
  8.  
  9.            transaction_history.currency,
  10.  
  11.            transaction_history.is_deleted,
  12.  
  13.            transaction_history.document_number,
  14.  
  15.            transaction_history.external_id,
  16.  
  17.            transaction_history.history_date,
  18.  
  19.            transaction_history.id,
  20.  
  21.            transaction_history.is_credit,
  22.  
  23.            ppc.name     payment_purpose_code_name,
  24.  
  25.            ppc.code     payment_purpose_code,
  26.  
  27.            transaction_history.operation_type,
  28.  
  29.            transaction_history.order_payer,
  30.  
  31.            transaction_history.order_receiver,
  32.  
  33.            transaction_history.payer,
  34.  
  35.            transaction_history.payer_account,
  36.  
  37.            transaction_history.payer_bank,
  38.  
  39.            transaction_history.payer_bank_bik,
  40.  
  41.            transaction_history.payer_bank_place,
  42.  
  43.            transaction_history.payer_bank_place_type,
  44.  
  45.            transaction_history.payer_bank_type,
  46.  
  47.            transaction_history.payer_bin,
  48.  
  49.            transaction_history.payer_corr_account,
  50.  
  51.            transaction_history.payer_property_type,
  52.  
  53.            transaction_history.payer_residency_code,
  54.  
  55.            transaction_history.payment_purpose,
  56.  
  57.            transaction_history.payment_purpose_code_id,
  58.  
  59.            transaction_history.receiver,
  60.  
  61.            transaction_history.receiver_account,
  62.  
  63.            transaction_history.receiver_account_bik,
  64.  
  65.            transaction_history.receiver_bank,
  66.  
  67.            transaction_history.receiver_bank_place,
  68.  
  69.            transaction_history.receiver_bank_place_type,
  70.  
  71.            transaction_history.receiver_bank_type,
  72.  
  73.            transaction_history.receiver_bin,
  74.  
  75.            transaction_history.receiver_corr_account,
  76.  
  77.            transaction_history.receiver_property_type,
  78.  
  79.            transaction_history.receiver_residency_code,
  80.  
  81.            transaction_history.value_date,
  82.  
  83.            accounts.account_number
  84.  
  85.       FROM transaction_history
  86.  
  87.            INNER JOIN accounts ON accounts.id = transaction_history.account_id
  88.  
  89.            LEFT JOIN payment_purpose_code ppc
  90.  
  91.                ON ppc.id = transaction_history.payment_purpose_code_id
  92.  
  93.      WHERE     (transaction_history.is_deleted = :1)
  94.  
  95.            AND (transaction_history.account_id = :2)
  96.  
  97.            AND (transaction_history.history_date BETWEEN TO_DATE ( :3,
  98.  
  99.                                                                   'YYYY.MM.DD')
  100.  
  101.                                                      AND TO_DATE ( :4,
  102.  
  103.                                                                   'YYYY.MM.DD'))
  104.  
  105.   ORDER BY history_date DESC, transaction_history.id DESC
  106.  
  107.     OFFSET 0 ROWS
  108.  
  109. FETCH NEXT 10 ROWS ONLY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement