-- ## 11: Popular Voted Tickets ## -- -- Tickets ordered by number of votes (> 0) -- -- You must be [/prefs registered] to vote. SELECT p.value AS __color__, t.type AS type, id AS ticket, sum(v.vote) as votes, summary, component, version, milestone, time AS created, changetime AS _changetime, description AS _description, reporter AS _reporter FROM ticket t, enum p, votes v WHERE status <> 'closed' AND p.name = t.priority AND p.type = 'priority' AND v.resource = 'ticket/' || id GROUP BY id, summary, component, version, t.type, owner, time, changetime, description, reporter, p.value, status HAVING sum(v.vote) > 0 ORDER BY votes DESC, t.type, time