{"id":445,"date":"2014-11-27T22:37:47","date_gmt":"2014-11-27T13:37:47","guid":{"rendered":"http:\/\/www.dbsheetclient.jp\/blog\/?p=445"},"modified":"2018-06-27T16:24:39","modified_gmt":"2018-06-27T07:24:39","slug":"%e9%9a%8e%e5%b1%a4%e6%a7%8b%e9%80%a0%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e8%a1%a8%e7%a4%ba%ef%bc%88oracle%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.dbsheetclient.jp\/blog\/?p=445","title":{"rendered":"\u968e\u5c64\u69cb\u9020\u306e\u30c7\u30fc\u30bf\u8868\u793a\uff08Oracle\uff09"},"content":{"rendered":"<p>IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u306e\u30b7\u30e5\u30a6\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/autumn-leaves_00007.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-446\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/autumn-leaves_00007-300x199.jpg\" alt=\"autumn-leaves_00007\" width=\"300\" height=\"199\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/autumn-leaves_00007-300x199.jpg 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/autumn-leaves_00007-1024x682.jpg 1024w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/autumn-leaves_00007.jpg 2048w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u95a2\u9023\u306e\u60c5\u5831\u3067\u3059\u3002<br \/> ITCA\uff08IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u5354\u4f1a\uff09\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306b\u306f\u3001\uff29\uff34\u6d3b\u7528\u3092\u8003\u3048\u3066\u3044\u308b\u4e2d\u5c0f\u4f01\u696d\u306e\u7686\u69d8\u3078\u3068\u984c\u3057\u3066\uff08\u7d4c\u6e08\u7523\u696d\u7701\u304b\u3089\u306e\u3054\u6848\u5185\u3068\u3044\u3046\u3053\u3068\u3067\uff09\u3001IT\u5c0e\u5165\u6642\u306b\u5229\u7528\u53ef\u80fd\u306a\u4e88\u7b97\u30fb\u878d\u8cc7\u5236\u5ea6\u306e\u7d39\u4ecb\u3084IT\u5c0e\u5165\u3092\u691c\u8a0e\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001\uff29\uff34\u6d3b\u7528\u306b\u6210\u529f\u3057\u305f\u4f01\u696d\u306e\u4e8b\u4f8b\u3092\u3044\u308d\u3044\u308d\u3068\u7d39\u4ecb\u3057\u3066\u3044\u308b\u30b5\u30a4\u30c8\u304c\u8f09\u305b\u3066\u3042\u308a\u307e\u3059\u3002<br \/> <a href=\"http:\/\/www.itc.or.jp\/kakushinit\/\">http:\/\/www.itc.or.jp\/kakushinit\/<br \/> <\/a>\u305d\u306e\u4e2d\u306e\u4e00\u3064\u306b\u3001\u4e2d\u5c0f\u4f01\u696d\u30fb\u5c0f\u898f\u6a21\u4e8b\u696d\u8005\u306e\u672a\u6765\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u30b5\u30a4\u30c8\u300c\u30df\u30e9\u30b5\u30dd\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u6628\u5e74\u958b\u8a2d\u3055\u308c\u3001\u56fd\u3084\u516c\u7684\u6a5f\u95a2\u306e\u652f\u63f4\u60c5\u5831\u30fb\u652f\u63f4\u65bd\u7b56\u7b49\u3044\u308d\u3044\u308d\u306a\u60c5\u5831\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u306d\u3002<br \/> <a href=\"https:\/\/www.mirasapo.jp\/index.html\">https:\/\/www.mirasapo.jp\/index.html<br \/> <\/a>\u307e\u305f\u3001IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u306b\u3088\u308b\u652f\u63f4\u4e8b\u4f8b\u3082\u4e0b\u8a18\u306e\u30b5\u30a4\u30c8\u306b\u3042\u308a\u307e\u3059\u3002<br \/> <a href=\"http:\/\/wwk.itc.or.jp\/itkeiei\/\">http:\/\/wwk.itc.or.jp\/itkeiei\/<br \/> <\/a>\uff29\uff34\uff23\uff21\u306e\u5ba3\u4f1d\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u304c\u3001\u3061\u3087\u3063\u3068\u7d39\u4ecb\u307e\u3067<br \/> <strong><br \/> \uff1c\u672c\u65e5\u306e\u984c\u6750\uff1e<br \/> \u968e\u5c64\u69cb\u9020\u306e\u30c7\u30fc\u30bf\u8868\u793a\uff08Oracle\uff09<\/strong><\/p>\n<p>\u4eca\u56de\u306f\u3001\u6642\u6298\u793e\u5185\u3067\u3082\u8a71\u984c\u306b\u306a\u308b\u968e\u5c64\u69cb\u9020\u306e\u30c7\u30fc\u30bf\u8868\u793a\u306b\u3064\u3044\u3066\u53d6\u308a\u4e0a\u3052\u3066\u307f\u307e\u3059\u3002<br \/> Oracle\u3067\u306f\u3001\u968e\u5c64\u69cb\u9020\u306e\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b\u306e\u306b\u4fbf\u5229\u306a START WITH\u53e5\u3001CONNECT BY\u53e5\u3068\u3044\u3046\u306e\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3088\u304f\u3001\u4f8b\u3068\u3057\u3066\u4e0a\u3052\u3089\u308c\u308b\u306e\u304c\u3001SCOTT\u30e6\u30fc\u30b6\u306e\u30c6\u30fc\u30d6\u30eb\u300cemp\u300d\u8868\u3067\u3001\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u5404\u5f93\u696d\u54e1\u306e\u4e0a\u53f8\u306e\u5f93\u696d\u54e1\u756a\u53f7\u304c\u9805\u76ee\u3068\u3057\u3066\u3042\u308a\u3001\u305d\u308c\u3092\u4f7f\u3063\u3066\u4e0a\u53f8\u3068\u90e8\u4e0b\u306e\u95a2\u4fc2\u3092\u968e\u5c64\u69cb\u9020\u3067\u8868\u793a\u3059\u308b\u4f8b\u3092\u898b\u3066\u307f\u307e\u3059\u3002\u4f8b\u3048\u3070\u4e0b\u8a18\u306e\u3088\u3046\u306aSQL\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>SELECT<br \/> E1.EMPNO AS \u5f93\u696d\u54e1\u756a\u53f7<br \/> , E1.ENAME AS \u5f93\u696d\u54e1\u540d<br \/> , LPAD(&#8216; &#8216;,(LEVEL-1)*2,&#8217; &#8216;)||E1.JOB AS \u8077\u52d9\u540d<br \/> , E1.MGR AS \u4e0a\u53f8\u5f93\u696d\u54e1\u756a\u53f7<br \/> , E2.ENAME AS \u4e0a\u53f8\u5f93\u696d\u54e1\u540d<br \/> , LEVEL AS \u968e\u5c64LEVEL<br \/> FROM EMP E1<br \/> LEFT OUTER JOIN (SELECT EMPNO, ENAME FROM EMP) E2<br \/> ON E1.MGR = E2.EMPNO<br \/> START WITH E1.JOB = &#8216;PRESIDENT&#8217;<br \/> CONNECT BY PRIOR E1.EMPNO = E1.MGR<br \/> ORDER SIBLINGS BY E1.ENAME;<br \/> <a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_1_2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-452\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_1_2-300x140.jpg\" alt=\"oracle_kaisou_1_2\" width=\"528\" height=\"246\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_1_2-300x140.jpg 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_1_2.jpg 717w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><br \/> <\/a><br \/> START WITH\u53e5\u3067\u3001E1.JOB=&#8217;PRESIDENT&#8217; (\u793e\u9577) \u3092\u8d77\u70b9\uff08\u30eb\u30fc\u30c8\uff09\u3068\u3057\u3066\u968e\u5c64\u8868\u793a\u3057\u3001CONNECT BY\u53e5\u3067\u89aa\u5b50\u95a2\u4fc2\u3092\u6761\u4ef6\u4ed8\u3051\u3057\u3066\u3044\u307e\u3059\u3002PRIOR E1.EMPNO = E1.MGR \u3067\u89aa\u306e\u30ec\u30b3\u30fc\u30c9\u306eEMPNO = \u5b50\u306e\u30ec\u30b3\u30fc\u30c9\u306eMGR \u3068\u3044\u3046\u6761\u4ef6\u306b\u306a\u308a\u307e\u3059\u3002<br \/> \u307e\u305f\u3001LEVEL \u306f\u968e\u5c64\u30ec\u30d9\u30eb\u3092\u610f\u5473\u3057\u3066\u3044\u3066\u3001\u8077\u52d9\u540d\u306e\u3068\u3053\u308d\u306e\u982d\u306b\u968e\u5c64LEVEL*2\u305a\u3064\u306e\u7a7a\u767d\u3092\u4ed8\u3051\u3066\u968e\u5c64\u304c\u5206\u304b\u308a\u3084\u3059\u304f\u3057\u3066\u3044\u307e\u3059\u3002<br \/> ORDER SIBLINGS BY\u53e5\u306f\u3001\u968e\u5c64\u554f\u3044\u5408\u308f\u305b\u306e\u5834\u5408\u306b\u3001CONNECT BY\u306e\u7d50\u679c\u306e\u968e\u5c64\u9806\u5e8f\u3092\u58ca\u3055\u305a\u30bd\u30fc\u30c8\u3057\u3066\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>START WITH\u53e5\u3067\u3001\u30eb\u30fc\u30c8\u3068\u306a\u308b\u306e\u304c JOB=&#8217;PRESIDENT&#8217; \u3068\u3044\u3046\u60c5\u5831\u304c\u308f\u304b\u3089\u306a\u3044\u5834\u5408\u306f\u3001MGR\u304cNULL\uff08\u4e0a\u53f8\u306e\u5f93\u696d\u54e1\u756a\u53f7\u304c\u306a\u3044\uff09\u306e\u30e1\u30f3\u30d0\u30fc\u304c\u968e\u5c64\u306eSTART\u3068\u3044\u3046\u3053\u3068\u304b\u3089\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>SELECT<br \/> E1.EMPNO AS \u5f93\u696d\u54e1\u756a\u53f7<br \/> , E1.ENAME AS \u5f93\u696d\u54e1\u540d<br \/> , LPAD(&#8216; &#8216;,(LEVEL-1)*2,&#8217; &#8216;)||E1.JOB AS \u8077\u52d9\u540d<br \/> , E1.MGR AS \u4e0a\u53f8\u5f93\u696d\u54e1\u756a\u53f7<br \/> , E2.ENAME AS \u4e0a\u53f8\u5f93\u696d\u54e1\u540d<br \/> , LEVEL AS \u968e\u5c64LEVEL<br \/> FROM EMP E1<br \/> LEFT OUTER JOIN (SELECT EMPNO, ENAME FROM EMP) E2<br \/> ON E1.MGR = E2.EMPNO<br \/> START WITH E1.EMPNO =<br \/> (SELECT EMPNO FROM EMP WHERE MGR IS NULL)<br \/> <span style=\"line-height: 1.5;\">CONNECT BY PRIOR E1.EMPNO = E1.MGR<br \/> <\/span><span style=\"line-height: 1.5;\">ORDER SIBLINGS BY E1.ENAME;<\/span><\/p>\n<p>\u203b\u7d50\u679c\u306f\u540c\u3058\u3067\u3059\u3002<br \/> \u307e\u305f\u3001SYS_CONNECT_BY_PATH(column, char) \u53e5\u3092\u4f7f\u3046\u3068\u3001\u30eb\u30fc\u30c8\u304b\u3089\u30ce\u30fc\u30c9\u3078\u306e\u5217(column)\u306e\u5024\u306e\u7d4c\u8def\u3092\u3001char \u3067\u6307\u5b9a\u3057\u305f\u6587\u5b57\u3067\u533a\u5207\u3063\u3066\u8fd4\u3059\u304b\u305f\u3061\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>SELECT<br \/> EMPNO AS \u5f93\u696d\u54e1\u756a\u53f7<br \/> , SYS_CONNECT_BY_PATH (JOB,&#8217;\/&#8217;) AS \u8077\u52d9\u30d1\u30b9<br \/> , ENAME AS \u5f93\u696d\u54e1\u540d<br \/> , CONNECT_BY_ROOT ENAME AS \u6700\u7d42\u4e0a\u53f8\u540d<br \/> FROM EMP<br \/> START WITH JOB = &#8216;PRESIDENT&#8217;<br \/> CONNECT BY PRIOR EMPNO = MGR<br \/> ORDER SIBLINGS BY ENAME;<br \/> <a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_2.jpg\"><br \/> <\/a><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-457\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_3-300x152.jpg\" alt=\"oracle_kaisou_3\" width=\"499\" height=\"253\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_3-300x152.jpg 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_3.jpg 648w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/a><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2014\/11\/oracle_kaisou_2.jpg\"><br \/> <\/a><\/p>\n<p>\u8077\u52d9\u30d1\u30b9\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u793e\u9577\u304b\u3089\u306e\u968e\u5c64\u3092\u533a\u5207\u308a\u6587\u5b57\u300c\/\u300d\u3092\u4f7f\u3063\u3066\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<br \/> \u203bCONNECT_BY_ROOT \u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u968e\u5c64\u306e\u30eb\u30fc\u30c8\u306e\u5024\uff08\u3053\u306e\u5834\u5408\u306f\u3001\u4e00\u756a\u306e\u4e0a\u53f8\uff09\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\uff08\u968e\u5c64\u306e\u30eb\u30fc\u30c8\u304c\u8907\u6570\u3042\u308b\u3088\u3046\u306a\u5834\u5408\u306f\u305d\u308c\u305e\u308c\u306e\u30eb\u30fc\u30c8\u306e\u5024\u304c\u53d6\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\uff09<br \/> \u3061\u306a\u307f\u306b\u3001\u4e0a\u8a18\u306e\u5185\u5bb9\u306f\u3001Oracle\u306e\u5834\u5408\u306b\u9650\u5b9a\u3057\u305f\u5185\u5bb9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u56de\u304b\u3089\u306f\u3001\u4ed6\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3082\u53ef\u80fd\u306a\u65b9\u6cd5\u3068\u3057\u3066\u3001\u518d\u5e30SQL\u306b\u3064\u3044\u3066\u3001\u53ca\u3073\u305d\u308c\u3092\u4f7f\u3063\u3066\u968e\u5c64\u69cb\u9020\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u53d6\u308a\u4e0a\u3052\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u65e5\u306f\u4ee5\u4e0a\u307e\u3067<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u306e\u30b7\u30e5\u30a6\u3067\u3059\u3002 IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u95a2\u9023\u306e\u60c5\u5831\u3067\u3059\u3002 ITCA\uff08IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u5354\u4f1a\uff09\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306b\u306f\u3001\uff29\uff34\u6d3b\u7528\u3092\u8003\u3048\u3066\u3044\u308b\u4e2d\u5c0f\u4f01\u696d\u306e\u7686\u69d8\u3078\u3068\u984c\u3057\u3066\uff08\u7d4c\u6e08\u7523\u696d\u7701\u304b\u3089\u306e\u3054\u6848\u5185\u3068\u3044\u3046\u3053\u3068\u3067\uff09\u3001IT\u5c0e\u5165\u6642\u306b [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[21,23],"tags":[],"class_list":["post-445","post","type-post","status-publish","format-standard","hentry","category-select","category-23"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=445"}],"version-history":[{"count":13,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions"}],"predecessor-version":[{"id":1969,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/445\/revisions\/1969"}],"wp:attachment":[{"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}