{"id":4819,"date":"2012-05-14T12:16:00","date_gmt":"2012-05-14T12:16:00","guid":{"rendered":""},"modified":"2026-04-18T22:48:19","modified_gmt":"2026-04-18T22:48:19","slug":"handy-sql","status":"publish","type":"post","link":"https:\/\/hellem.org\/wblog\/?p=4819","title":{"rendered":"Handy SQL"},"content":{"rendered":"<p>Created this SQL-statement used for one of our JIRA-instances. Needed to get rid of a lot of open sub-tasks where the parent task had been cancelled. The statement also shows usage of inner join and self-join.<br \/>\n<!-- codeblock lang=\"sql\" line=\"1\" --><\/p>\n<pre><code> U PDATE jiraissue ji1, jiraissue ji2\r\nINNER JOIN issuelink il\r\nSET ji1.resolution = 9, ji1.issuestatus = 6\r\nWHERE ji1.resolution  IS NULL\r\nAND ji1.id = il.destination\r\nAND ji1.issuestatus = 1\r\nAND il.source = ji2.id\r\nAND ji2.resolution = 9;\r\n<\/code><\/pre>\n<p><!-- \/codeblock --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Created this SQL-statement used for one of our JIRA-instances. Needed to get rid of a lot of open sub-tasks where the parent task had been cancelled. The statement also shows usage of inner join and self-join. U PDATE jiraissue ji1, jiraissue ji2 INNER JOIN issuelink il SET ji1.resolution = 9, ji1.issuestatus = 6 WHERE ji1.resolution [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-4819","post","type-post","status-publish","format-standard","hentry","category-work-geek"],"_links":{"self":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4819"}],"version-history":[{"count":1,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4819\/revisions"}],"predecessor-version":[{"id":12797,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/4819\/revisions\/12797"}],"wp:attachment":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}