I have the following Query
:
select
MONTHNAME(ta2.change_time) as mes,
MONTH(ta2.change_time) as numeroMes,
case
when s2.name like '%Servidores' then cast(SUM(ta2.time_unit) as UNSIGNED) * 1.5 else cast(SUM(ta2.time_unit) as UNSIGNED)
end as TEMPO_CORRETO
from
otrs.service s2,
otrs.time_accounting ta2,
otrs.ticket t2,
otrs.ticket_type tt2
where
t2.id = ta2.ticket_id and
t2.type_id = tt2.id and
t2.service_id = s2.id and
ta2.change_time between '2018-04-01' and '2018-04-30' and
t2.customer_id = 'ZSCHIMMER SCHWARZ' and
tt2.name = 'Contrato PCH'
group by
t2.customer_id,
s2.name
order by
numeroMes
But I'm having the following return:
ButIwouldliketogroupthesevaluesbymonth,havingoneresultslikethis:
I've tried everything but I have not got it yet, if you have an idea.