jcarlosriverae

Untitled

Sep 13th, 2021
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.48 KB | None | 0 0
  1. select
  2.     tac.id_cuenta_ahorro
  3.     ,SUM(tac.valor_real)
  4. from
  5.     alquimia_vitae.transacciones_ahorro_cliente tac
  6. WHERE
  7.     tac.id_cuenta_ahorro in
  8.         (
  9.             select
  10.                 tac.id_cuenta_ahorro
  11.             from
  12.                 transacciones_ahorro_cliente tac join cuenta_ahorro_medio_pago camp on  camp.id_cuenta_ahorro = tac.id_cuenta_ahorro
  13.             where camp.id_medio_pago = 4
  14.             group by tac.id_cuenta_ahorro
  15.         )
  16.     and tac.fecha_alta >= '2021-09-01'
  17.     and tac.tipo_movimiento = 34
  18. GROUP BY
  19.     tac.id_cuenta_ahorro
Advertisement
Add Comment
Please, Sign In to add comment