Advertisement
mestretcp

Consultar tabela financeira em formato de extrato bancário

Jan 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.20 KB | None | 0 0
  1. set @total=0;
  2. select  
  3.   data,  
  4.   tipo,  
  5.   documento,
  6.   IF (valor>0,valor,0) as credito,
  7.   IF (valor<0,valor,0) as debito,  
  8.   @total:=@total+valor as saldo
  9. from fin_lancamentos
  10. order by data;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement