Bugzilla:SQLCookBook: Difference between revisions

Jump to navigation Jump to search
Line 39: Line 39:


-----
-----
===Get a list of the bug opening times from bugs, and combine it with the bugs_activity table to make a table which actually has all the transitions in it.===
===Get a list of the bug opening times from bugs, and combine it with the
bugs_activity table to make a table which actually has all the transitions in it.===
''Note that I actually limit to the changes in field 9, which is the bug status.''
''Note that I actually limit to the changes in field 9, which is the bug status.''


select bug_id, creation_ts, 'OPENED' from bugs union all select bug_id, bug_when, added from bugs_activity where fieldid = 9 order by bug_id;
<pre>
select bug_id, creation_ts, 'OPENED' from bugs
union all select bug_id, bug_when, added from bugs_activity
where fieldid = 9 order by bug_id;
</pre>


-----


-----
===Insert a set of milestones into all the products of a classification, multiple times:===
===Insert a set of milestones into all the products of a classification, multiple times:===


16

edits

Navigation menu