You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-06-28 15:17:21

sebastianxxx
Member
Registered: 2018-06-01
Posts: 9

Query in MYSQL

Good morning, I would like to know if I could make a query in MySQL to compare the number of tickets by year and by month. The idea is to transfer the mysql to GRAFANA.


https://blogger.googleusercontent.com/i … s640/1.png



It would be like this graph but you would need the MYSQL code.

Last edited by sebastianxxx (2024-06-28 15:31:43)

Offline

#2 2024-06-28 16:12:00

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

Re: Query in MYSQL

select year(ti.date) as 'year',month(ti.date) as 'month', count(ti.id) as 'count' 
from glpi_tickets as ti
where ti.date>'2023-01-01'
group by year,month

Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

#3 2024-06-28 17:14:46

sebastianxxx
Member
Registered: 2018-06-01
Posts: 9

Re: Query in MYSQL

LaDenrée wrote:
select year(ti.date) as 'year',month(ti.date) as 'month', count(ti.id) as 'count' 
from glpi_tickets as ti
where ti.date>'2023-01-01'
group by year,month


Thank you very much friend, the query is perfect, but in GRAFANA I am doing something wrong and it is not working for me. Anyway, I thank you very much for your help.

Offline

Board footer

Powered by FluxBB