{"id":1381,"date":"2018-04-24T23:25:31","date_gmt":"2018-04-24T14:25:31","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=1381"},"modified":"2023-05-28T08:35:18","modified_gmt":"2023-05-27T23:35:18","slug":"%e3%80%90%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e8%a8%ad%e8%a8%88%e3%80%91%e3%83%93%e3%83%a5%e3%83%bc%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=1381","title":{"rendered":"\u3010\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u8a2d\u8a08\u3011\u30d3\u30e5\u30fc\u306e\u57fa\u672c"},"content":{"rendered":"<p>\u300c\u30d3\u30e5\u30fc\u300d\u306f\u3001\u5b9f\u969b\u306e\u958b\u767a\u73fe\u5834\u3067\u975e\u5e38\u306b\u591a\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6280\u8853\u3067\u3059\u3002<\/p>\n<p>\u30e1\u30ea\u30c3\u30c8\u3001\u30c7\u30e1\u30ea\u30c3\u30c8\u3092\u77e5\u308a\u3001\u8a2d\u8a08\u6642\u306b\u30d3\u30e5\u30fc\u3092\u6d3b\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u5224\u65ad\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n<h2>\u30d3\u30e5\u30fc\u3068\u306f\uff1f<\/h2>\n<p>SQL\u3092\u5b9f\u884c\u3059\u308b\u89b3\u70b9\u3067\u898b\u308c\u3070\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u30c6\u30fc\u30d6\u30eb\u3068\u540c\u3058\u3082\u306e\u300d<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h2>\u30d3\u30e5\u30fc\u306e\u4f7f\u3044\u65b9<\/h2>\n<h3>\u69cb\u6587<\/h3>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nCREATE VIEW \u30d3\u30e5\u30fc\u540d\u3000AS SELECT\u6587\r\n<\/pre>\n<h3>\u4f8b<\/h3>\n<p>\u30e6\u30fc\u30b6\u30fc\u30de\u30b9\u30bf\u30fc\u304b\u3089\u3001\u4e2d\u5e74\u793e\u54e1\u3092\u62bd\u51fa\u3057\u305f\u30d3\u30e5\u30fc\u3092\u4f5c\u308b\u5834\u5408<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nCREATE VIEW TYUNEN AS\r\nSELECT * FROM USER_MASTER\r\nWHERE AGE &gt; '35'\r\nAND AGE &lt; '50'\r\n<\/pre>\n<h2>\u30d3\u30e5\u30fc\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n<h3>SQL\u304c\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u308b\u70b9<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u4e0a\u8a18\u306e\u4f8b\u3067\u8a00\u3048\u3070\u3001\u4e2d\u5e74\u793e\u54e1\u306e\u65b9\u306e\u7d66\u6599\u3092\u4e00\u89a7\u5316\u3059\u308b\u5834\u5408\u3068\u3001\u4e2d\u5e74\u793e\u54e1\u306e\u65b9\u306e\u90e8\u7f72\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u5834\u5408\u304c\u3042\u3063\u305f\u3068\u3057\u305f\u3089\u3001\u305d\u308c\u305e\u308c\u308f\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>\u30d3\u30e5\u30fc\u3092\u4f7f\u3046\u524d<\/h4>\n<p>\u305d\u308c\u305e\u308c\u3001SELECT\u6587\u3067\u306e\u96c6\u8a08\u306e\u4ed5\u65b9\u304c\u9055\u3046\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5197\u9577\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nSELECT SALARY FROM TYUNEN\r\nWHERE AGE &gt; '35' AND AGE &lt; '50'; \/\/SQL1 \r\n\r\nSELECT DEPARTMENT FROM USER_MASTER \r\nWHERE AGE &gt; '35' AND AGE &lt; '50'\r\nGROUP BY DEPARTMENT;\/\/SQL2\r\n<\/pre>\n<h4>\u30d3\u30e5\u30fc\u3092\u4f7f\u3063\u3066\u66f8\u304f\u5834\u5408<\/h4>\n<p>\u305d\u308c\u305e\u308c\u3001\u975e\u5e38\u306bSQL\u304c\u3059\u3063\u304d\u308a\u3057\u307e\u3057\u305f\u306d\u3002<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nSELECT SALARY FROM TYUNEN; \/\/SQL1\r\n\r\nSELECT DEPARTMENT FROM TYUNEN\r\nGROUP BY DEPARTMENT;\/\/SQL2\r\n<\/pre>\n<p>\u4ed6\u306b\u306f\u3001\u826f\u304f\u4f7f\u3046<span style=\"color: #ff0000;\"><strong>\u300c\u7d50\u5408\u6e08\u307f\u306e\u30c6\u30fc\u30d6\u30eb\u300d\u306a\u3093\u304b<\/strong><\/span>\u3092\u3001\u30d3\u30e5\u30fc\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u304a\u304f\u3068\u975e\u5e38\u306b\u4fbf\u5229\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h3>\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u3092\u5272\u308a\u632f\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u70b9<\/h3>\n<p>\u300c\u3042\u308a\u306e\u307e\u307e\u306e\u30c6\u30fc\u30d6\u30ebA\u300d\u3001<strong>\u300c\u30c6\u30fc\u30d6\u30ebA\u304b\u3089\u3001\u6a5f\u5bc6\u60c5\u5831\u3092\u9664\u3044\u305f\u30d3\u30e5\u30fcB\u300d<\/strong>\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u305d\u308c\u305e\u308c\u4f5c\u3063\u3066\u304a\u304d\u3001\u5229\u7528\u8005\u306e\u6a29\u9650\u306b\u5fdc\u3058\u3066\u3001\u3069\u3061\u3089\u3092\u4f7f\u3046\u304b\u632f\u308a\u4e7e\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30d3\u30e5\u30fc\u306e\u30c7\u30e1\u30ea\u30c3\u30c8<\/h2>\n<h3>\u60f3\u50cf\u4ee5\u4e0a\u306b\u8907\u96d1\u306aSQL\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3082\u2026\u3002<\/h3>\n<p>\u30d3\u30e5\u30fc\u306f\u3001\u3042\u304f\u307e\u3067\u3001<strong>SELECT\u6587\u306b\u540d\u524d\u3092\u3064\u3051\u305f\u3060\u3051\u306e\u3082\u306e<\/strong>\u306b\u904e\u304e\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001SQL\u304c\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u308a\u308f\u3059\u308b\u304c\u3001<span style=\"color: #ff0000;\"><strong>SQL\u306e\u5b9f\u884c\u901f\u5ea6\u81ea\u4f53\u304c\u65e9\u304f\u306a\u308b\u3053\u3068\u306f\u306a\u3044<\/strong><\/span>\u306e\u3067\u3059\u3002<\/p>\n<p>\u5b89\u6613\u306b\u3001<strong>\u30d3\u30e5\u30fc\u3067\u7c21\u7d20\u5316\u3055\u308c\u305f\u304b\u3089\u3001\u5c11\u3057\u8907\u96d1\u306aSQL\u3092\u66f8\u3044\u3066\u3084\u308d\u3046\u3068\u601d\u3046\u3068\u3001\u601d\u3063\u305f\u3088\u308a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u60aa\u304f\u306a\u308b\u3053\u3068\u304c\u3042\u308b<\/strong>\u306e\u3067\u3001\u6c17\u3092\u3064\u3051\u307e\u3057\u3087\u3046\uff01<\/p>\n<h2>\u30d3\u30e5\u30fc\u306e\u6ce8\u610f\u70b9<\/h2>\n<h3>\u30d3\u30e5\u30fc\u3067ORDER BY\u53e5\u306f\u4f7f\u3048\u306a\u3044\u3067\u3059\u3002<\/h3>\n<p>\u30d3\u30e5\u30fc\u3067\u306fOREDER BY\u53e5\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001\u30d3\u30e5\u30fc\u306b\u306f<span style=\"color: #ff0000;\"><strong>\u300c\u884c\u306b\u9806\u5e8f\u3068\u3044\u3046\u6982\u5ff5\u304c\u306a\u3044\u300d<\/strong><\/span>\u305f\u3081\u3067\u3059\u3002\u4e2d\u306b\u306f\u3001\u30d3\u30e5\u30fc\u306bORDER BY\u53e5\u3092\u8a31\u3059RDBMS\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u57fa\u672c\u7684\u306b\u306f\u8a31\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u4f7f\u7528\u3057\u306a\u3044\u3067\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u30d3\u30e5\u30fc\u306f\u3001\u7279\u5b9a\u6761\u4ef6\u3067\u66f4\u65b0\u304c\u53ef\u80fd\u3067\u3059\u3002<\/h2>\n<p>\u30d3\u30e5\u30fc\u306f\u57fa\u672c\u7684\u306b\u3001\u76f4\u63a5\u66f4\u65b0\u3059\u308b\u3053\u3068\u304c\u8a31\u3055\u308c\u306a\u3044\u3067\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u4e0b\u8a18\u306e\u6761\u4ef6\u3092\u6e80\u305f\u305b\u3070\u66f4\u65b0\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<ul>\n<li>SELECT\u53e5\u306bDISTINCT\u30ad\u30fc\u30ef\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u5834\u5408<\/li>\n<li>FROM\u53e5\u306b\u542b\u307e\u308c\u308b\u30c6\u30fc\u30d6\u30eb\u304c\u4e00\u3064\u3060\u3051\u306e\u5834\u5408<\/li>\n<li>\u300cGROUP BY\u53e5\u300d\u3001\u300cHAVING\u53e5\u300d\u3092\u305d\u308c\u305e\u308c\u4f7f\u7528\u3057\u3066\u3044\u306a\u3044\u5834\u5408<\/li>\n<\/ul>\n<h2>\u300c\u30de\u30c6\u30ea\u30a2\u30e9\u30a4\u30ba\u30c9\u300d\u30fb\u30d3\u30e5\u30fc\u3068\u306f\uff1f<\/h2>\n<p>SELECT\u6587\u306e\u5b9f\u884c\u7d50\u679c\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u3066\u3044\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3001\u30c7\u30fc\u30bf\u3092\u76f4\u63a5\u3082\u3063\u3066\u304a\u308a\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u4f7f\u3048\u308b\u306e\u3067<span style=\"color: #ff0000;\"><strong>\u300c\u6027\u80fd\u306e\u3088\u3044\u30d3\u30e5\u30fc\u300d<\/strong><\/span>\u3068\u3044\u3046\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<p>\u6027\u80fd\u91cd\u8996\u3067\u3042\u308b\u5834\u5408\u306f\u3001\u3053\u3061\u3089\u306e\u5229\u7528\u3082\u691c\u8a0e\u3055\u308c\u3066\u3082\u3088\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u203b\u4e00\u90e8\u306eDBMS\u3067<\/strong><\/span>\u5229\u7528\u53ef\u80fd\u306a\u6a5f\u80fd\u306b\u306a\u308b\u306e\u3067\u3001\u5b9f\u52d9\u3067\u907f\u3051\u3089\u308c\u308b\u50be\u5411\u306b\u3042\u308a\u307e\u3059\u3002\u3042\u307e\u308a\u304a\u76ee\u306b\u304b\u304b\u308b\u6a5f\u4f1a\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u300c\u30d3\u30e5\u30fc\u300d\u306f\u3001\u5b9f\u969b\u306e\u958b\u767a\u73fe\u5834\u3067\u975e\u5e38\u306b\u591a\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6280\u8853\u3067\u3059\u3002 \u30e1\u30ea\u30c3\u30c8\u3001\u30c7\u30e1\u30ea\u30c3\u30c8\u3092\u77e5\u308a\u3001\u8a2d\u8a08\u6642\u306b\u30d3\u30e5\u30fc\u3092\u6d3b\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u5224\u65ad\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\uff01 \u30d3\u30e5\u30fc\u3068\u306f\uff1f SQL\u3092\u5b9f\u884c\u3059\u308b\u89b3\u70b9\u3067\u898b\u308c\u3070\u3001\u300c\u30c6\u30fc\u30d6 [&hellip;]","protected":false},"author":1,"featured_media":1397,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1381"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1381"}],"version-history":[{"count":18,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1381\/revisions"}],"predecessor-version":[{"id":20767,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/1381\/revisions\/20767"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/1397"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1381"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}