Ya, the more I looked into it, the less likely it seemed that I could
do it with a single query. My boss really wanted separate tables for
each user, so I just ended up making a wiki page that ran a query for
each milestone and then grouped the results by user. It seems like
that's the only way to work around this.

On Tue, Nov 9, 2010 at 12:18 AM, Cooke, Mark <[email protected]> wrote:
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of J.J. Montgomery
>> Sent: 08 November 2010 17:30
>> To: [email protected]
>> 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 [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/trac-users?hl=en.
>
>

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

Reply via email to