Advertisement
tduganov

Untitled

Apr 22nd, 2021
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.17 KB | None | 0 0
  1. SELECT
  2.   transaction_history.account_id,
  3.   transaction_history.amount,
  4.   transaction_history.amount_national,
  5.   transaction_history.budget_code,
  6.   transaction_history.currency,
  7.   transaction_history.is_deleted,
  8.   transaction_history.document_number,
  9.   transaction_history.external_id,
  10.   transaction_history.history_date,
  11.   transaction_history.id,
  12.   transaction_history.is_credit,
  13.   ppc.name payment_purpose_code_name,
  14.   ppc.code payment_purpose_code,
  15.   transaction_history.operation_type,
  16.   transaction_history.order_payer,
  17.   transaction_history.order_receiver,
  18.   transaction_history.payer,
  19.   transaction_history.payer_account,
  20.   transaction_history.payer_bank,
  21.   transaction_history.payer_bank_bik,
  22.   transaction_history.payer_bank_place,
  23.   transaction_history.payer_bank_place_type,
  24.   transaction_history.payer_bank_type,
  25.   transaction_history.payer_bin,
  26.   transaction_history.payer_corr_account,
  27.   transaction_history.payer_property_type,
  28.   transaction_history.payer_residency_code,
  29.   transaction_history.payment_purpose,
  30.   transaction_history.payment_purpose_code_id,
  31.   transaction_history.receiver,
  32.   transaction_history.receiver_account,
  33.   transaction_history.receiver_account_bik,
  34.   transaction_history.receiver_bank,
  35.   transaction_history.receiver_bank_place,
  36.   transaction_history.receiver_bank_place_type,
  37.   transaction_history.receiver_bank_type,
  38.   transaction_history.receiver_bin,
  39.   transaction_history.receiver_corr_account,
  40.   transaction_history.receiver_property_type,
  41.   transaction_history.receiver_residency_code,
  42.   transaction_history.value_date,
  43.   accounts.account_number
  44. FROM
  45.   transaction_history
  46.   INNER JOIN accounts ON accounts.id = transaction_history.account_id
  47.   LEFT JOIN payment_purpose_code ppc ON ppc.id = transaction_history.payment_purpose_code_id
  48. WHERE
  49.   (
  50.     transaction_history.is_deleted = : 1
  51.   )
  52.   AND (
  53.     transaction_history.account_id = : 2
  54.   )
  55.   AND (
  56.     transaction_history.history_date BETWEEN TO_DATE (: 3, 'YYYY.MM.DD')
  57.     AND TO_DATE (: 4, 'YYYY.MM.DD')
  58.   )
  59. ORDER BY
  60.   history_date DESC,
  61.   transaction_history.id DESC OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement