2
I have a table historicos
:
historicos
id | problemas | total | data
---|-----------|-------|------------
01 | 25 | 125 | 2017-01-01
---|-----------|-------|------------
03 | 25 | 125 | 2017-03-01
---|-----------|-------|------------
04 | 25 | 125 | 2017-04-01
---|-----------|-------|------------
08 | 25 | 125 | 2017-08-01
---|-----------|-------|------------
09 | 25 | 125 | 2017-09-01
---|-----------|-------|------------
10 | 25 | 125 | 2017-10-01
---|-----------|-------|------------
12 | 25 | 125 | 2017-12-01
I need to print even months with the sum of fields problemas
and total
, ie, for example, need to display the sum of month 1 with month 2, month 3 with month 4, month 5 with 6 and so on...
See the Fiddle
example below:
If the link fails, try opening again!
It really works, but not with two values within the
subquery
, now I’m using the same logic to do with the other value, one withproblemas
and another withtotal
– Marcos Henzel