Summing ticket charges

If you want to get the sum of all charges on a ticket, you can do this:

 

SELECT tickets.subject, TIME_FORMAT(SEC_TO_TIME(SUM(tickets.charges.charge_time)), '%Hh %im') AS 'Charge Time'

FROM tickets

GROUP BY tickets.id AS 'ID'

Helpful Unhelpful

14 of 26 people found this page helpful

Add a comment

You need to log in before you can submit a comment.

Need a password reminder?