SELECT COUNT(*) FROM (
SELECT p.value AS __color__,
id AS ticket, summary, component, version, milestone AS __group__, priority, severity, t.type AS type,
owner,
reporter,
status,
time AS created,
changetime AS _changetime, description AS _description
FROM ticket t
LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
LEFT JOIN enum q ON q.name = t.severity and q.type = 'severity'
LEFT JOIN enum r ON r.name = t.type and r.type = 'ticket_type'
WHERE status <> 'closed'
ORDER BY milestone, CAST(p.value AS int), time, CAST(q.value AS int), CAST(r.value AS int)
) AS tab
Note:
See TracReports
for help on using and creating reports.