MySQL Forums
Forum List  »  Spanish

Re: Agrupacion en consultas
Posted by: Marco Rios
Date: October 03, 2016 05:08PM

De una manera sencilla, puedes cambiar el formato del CASE por un IF:

CASE WHEN Month(e.FechFact) = 1 THEN Sum(d.CantServ) ELSE 0 END) AS Ene
por
SUM(IF(Month(e.FechFact) = 1,d.CantServ,0)) AS Ene
...

Thanks in advance for your valuable help.

Acer LENOVO G450
CPU: Pentium(R) Dual-Core CPU T4400 @ 2.20GHz × 2
RAM: 4GB
Graphics: Intel GM45
OS: UBUNTU 18.04.4 LTS 64bits
GNOME 3.28.2
--
Best regards
Marco
Mexico City, Mexico

Options: ReplyQuote


Subject
Views
Written By
Posted
1348
September 28, 2016 08:09AM
542
September 28, 2016 09:51PM
Re: Agrupacion en consultas
615
October 03, 2016 05:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.