Posts by Rafael Mota • 41 points
2 posts
-
2
votes4
answers1133
viewsA: Return a sum in separate rows in mysql
you can try this way select sum(case when operacao=2 then valor*-1 else valor end) from tabela GROUP by id_cliente
-
2
votes4
answers103
viewsA: Problems formatting the date type returned from select
try using the mysql date format function select date_format(D.Mes_Ref,'%m/%Y')