Ir al contenido principal

Using the DPQL_COUNT function - Base de conocimiento / Using Deskpro / Reports - Deskpro Support

Using the DPQL_COUNT function

Lista de autores

The count function simply counts the rows that fit the criteria specified in your report.

A simple example would be: 

SELECT DPQL_COUNT() AS 'Total tickets'

FROM tickets

This would return the number of tickets you have in Deskpro as it counts the number of rows in the ticket tables.

Note


The 'AS' function is renaming the columns in the output.  So rather than the ticket being named DPQL_COUNT(), it is called 'Total Tickets'

You can also narrow down the count using the WHERE clause.

For example, if you wanted to count the number of resolved tickets in the system, you could run the query:

SELECT DPQL_COUNT() AS 'Total tickets'

FROM tickets

WHERE tickets.status = 'resolved'


Útil Poco útil