メインコンテンツへスキップ

Using the DPQL_COUNT function - ナレッジベース / DPQL - DeskPRO

Using the DPQL_COUNT function

作成者一覧


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 is counting the number of rows in the ticket tables.


Note that 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.

If for example you wanted to count the number of resolved tickets in the system you could run:


SELECT DPQL_COUNT() AS 'Total tickets'

FROM tickets

WHERE tickets.status = 'resolved'

参考になった 役に立たない

2 人中 1 人がこのページは参考になったと答えました

コメントを追加

コメントを投稿するには、ログインまたは登録が必要です。

パスワードをお忘れですか?