- 依使用者分群
- 依priority排序
- 已經closed的ticket會排到最後面,同時以灰色字顯示
- 已經assigned的以藍色底顯示
SELECT
owner AS __group__,
(CASE status WHEN 'closed' THEN 'color: #aaaaaa'
ELSE ''
END) AS __style__,
(CASE status WHEN 'assigned' THEN 4
ELSE 3
END) AS __color__,
id AS ticket,
status,
priority,
summary,
component,
t.type AS type,
time AS created,
changetime AS _changetime,
description AS _description,
reporter AS _reporter
FROM ticket t,enum p
where
p.name=t.priority AND
p.type='priority' AND
t.milestone='***里程碑***'
ORDER BY owner, (status = 'closed') ,p.value, t.type, time