Last active
March 19, 2020 18:40
-
-
Save dorkness-io/5fb35a0e0d9936f0019554d84ec9a62a to your computer and use it in GitHub Desktop.
An example to illustrate how unions work. This query unions the os_currentstep and os_historystep table to get the timestamps of all status transitions for issues. You'd be much better off using changegroup/changeitem without a union, but I needed an example :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
p.pkey || '-' || ji.issuenum AS issue_key | |
,cs.start_date | |
from jiraissue ji | |
join project p | |
on ji.project = p.id | |
join os_currentstep cs | |
on ji.workflow_id = cs.entry_id | |
union | |
select | |
p.pkey || '-' || ji.issuenum AS issue_key | |
,hs.start_date | |
from jiraissue ji | |
join project p | |
on ji.project = p.id | |
join os_historystep hs | |
on ji.workflow_id = hs.entry_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment