Neidio i'r brif gynnwys

SUM

yn List of Functions
Rhestr o awduron
Cyhoeddwyd: Jun 27, 2019|Diweddarwyd diwethaf: Nov 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.

DefnyddiolAnnefnyddiol
tudalen nesafAVG
tudalen flaenorolDPQL_ALIAS

Mewngofnodwch neu cofrestrwch i gyflwyno sylw.