Skip to main content

SUM

in List of Functions
Authors list
Опубликованный: 27 июн. 2019 г.|Last updated: 3 нояб. 2022 г.

It can sometimes be useful to have a custom field on a ticket to record a number.

If perhaps it is a ticket requesting equipment, you may want to record the number of items that have been issued.

When it comes to reporting on this number you can add entries from multiple tickets together to form a total using the MYSQL SUM function.

A simple example would be the below where #1 is the ticket field id

SELECT SUM(tickets.custom_data[1]) AS 'Total' FROM tickets
copy

Note with this function it does not require the DPQL prefix.

ПолезноUnhelpful
next pageAVG
previous pageDPQL_ALIAS

Please log in or register to submit a comment.