> -----Original Message-----
> From: trac-users@googlegroups.com 
> [mailto:trac-us...@googlegroups.com] On Behalf Of J.J. Montgomery
> Sent: 08 November 2010 17:30
> To: trac-users@googlegroups.com
> Subject: [Trac] Making a report (or query) with nested groups
> 
> I've done a lot of searching on this, but haven't been able to find
> out exactly how to display more than one level of groups in a report
> in Trac 0.12. For example, I have this report:
> 
> SELECT p.value AS __color__,
>    'Milestone '||milestone AS __group__,
>    id AS ticket, summary, component, version, t.type AS type,
>    owner, status,
>    time AS created,
>    changetime AS _changetime, description AS _description,
>    reporter AS _reporter
>   FROM ticket t
>   LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
>   WHERE status <> 'closed'
>   ORDER BY (milestone IS NULL),milestone, CAST(p.value AS 
> int), t.type, time
> 
> That groups tickets by milestone. Is there a way that I can group
> tickets within each milestone group by owner? For example, something
> that looks like this:
> 
> MILESTONE1
>     Owner1
>         <ticket>
>         <ticket>
>         <ticket>
>     Owner2
>         <ticket>
>         <ticket>
> 
> 
> MILESTONE2
>     Owner1
>         <ticket>
>         <ticket>
>     Owner2
>         <ticket>
> 
> Thanks for any help you can provide, I am new to both Trac and SQL.
> 
Given the lack of replies I think you can assume that the short answer
is 'no'.

However, having grouped by milestone using your report, you could always
include 'owner' in your ORDER BY statement to default sort the tables.
Something like (untried):

>   ORDER BY (milestone IS NULL), milestone, owner, 
>             CAST(p.value AS int), t.type, time

~ mark c

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-us...@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to