#3393: Error in Custom Report using subquery
---------------------------+------------------------------------------------
Reporter: anonymous | Owner: daniel
Type: defect | Status: new
Priority: normal | Milestone:
Component: report system | Version: 0.9.5
Severity: normal | Keywords:
---------------------------+------------------------------------------------
I created a custom report using the following SQLite query
{{{
SELECT p.value AS __color__,
id AS ticket, summary, component, version, milestone, t.severity AS
severity,
(CASE status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS owner,
(CASE WHEN strftime('%%s','now') - changetime > 86400
THEN round((strftime('%%s','now') - changetime)/86400,0) || '
days'
WHEN strftime('%%s','now') - changetime > 3600
THEN round((strftime('%%s','now') - changetime)/3600,0) || '
hours'
ELSE (strftime('%%s','now') - changetime)/60 || ' mins'
END) AS Modified,
(SELECT author FROM ticket_change WHERE ticket = t.id AND field =
'comment' LIMIT 1) AS Modified_By,
description AS _description,
reporter AS _reporter
FROM ticket t, enum p
WHERE status IN ('new', 'assigned', 'reopened')
AND p.name = t.priority AND p.type = 'priority'
ORDER BY changetime desc, p.value, milestone, t.severity, time
}}}
The query executes correctly in SQLite, but trac complains about the
subquery saying:
[[br]]Report execution failed: no such column: t.id
--
Ticket URL: <http://trac.edgewall.org/ticket/3393>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets