-- ## 4: Active Tickets by Owner ## -- -- List active tickets, group by ticket owner, sorted by priority. SELECT p.value AS __color__, owner AS __group__, id AS ticket, summary, component, milestone, time AS created, changetime AS _changetime, description AS _description, reporter AS _reporter, t.priority, t.severity, t.type AS type, status FROM ticket t LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority' LEFT JOIN enum s ON s.name = t.severity AND s.type = 'severity' LEFT JOIN enum y ON y.name = t.type AND y.type = 'type' WHERE status <> 'closed' ORDER BY owner desc, CAST(p.value AS int), CAST(s.value AS int), CAST(y.value AS int), time