{"id":5480,"date":"2025-07-30T16:17:16","date_gmt":"2025-07-30T07:17:16","guid":{"rendered":"https:\/\/sky-peace.net\/?p=5480"},"modified":"2025-07-30T16:17:16","modified_gmt":"2025-07-30T07:17:16","slug":"db-create-view","status":"publish","type":"post","link":"https:\/\/sky-peace.net\/certified\/db-create-view\/","title":{"rendered":"CREATE VIEW \u306e\u69cb\u6587\u5b8c\u5168\u7406\u89e3\u2502\u5348\u5f8c\u8a66\u9a13\u306eUNION\u30fbJOIN\u554f\u984c\u3092\u653b\u7565\u3059\u308b\u30dd\u30a4\u30f3\u30c8"},"content":{"rendered":"<p>\u5348\u5f8c\u8a66\u9a13\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5206\u91ce\u3067\u306f\u3001\u300c<code>CREATE VIEW<\/code>\u300d\u6587\u3092\u4f7f\u3063\u305f\u30d3\u30e5\u30fc\u5b9a\u7fa9\u306e\u554f\u984c\u304c\u983b\u51fa\u3067\u3059\u3002\u7279\u306b\u3001\u300c<code>AS<\/code> \u306e\u5f8c\u308d\u306b <code>SELECT<\/code> \u6587\u304c\u76f4\u63a5\u7d9a\u304f\u69cb\u6587\u300d\u306b\u5bfe\u3057\u3066\u9055\u548c\u611f\u3084\u6238\u60d1\u3044\u3092\u899a\u3048\u308b\u53d7\u9a13\u8005\u306f\u591a\u304f\u3001\u51fa\u984c\u8005\u306e\u72d9\u3044\u3067\u3082\u3042\u308b\u300c\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3068\u30d3\u30e5\u30fc\u306e\u69cb\u9020\u7406\u89e3\u300d\u304c\u8a66\u3055\u308c\u308b\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u53d6\u308a\u4e0a\u3052\u308b\u56f3\u66f8\u9928\u30b7\u30b9\u30c6\u30e0\u306e\u4f8b\u3067\u306f\u3001<strong>\u8907\u6570\u306e\u81ea\u6cbb\u4f53\uff08A\u5e02\u30fbB\u5e02\uff09\u306b\u304a\u3051\u308b\u66f8\u7c4d\u30fb\u8cb8\u51fa\u7ba1\u7406\u30c6\u30fc\u30d6\u30eb<\/strong>\u3092\u5143\u306b\u3001\u7d71\u4e00\u3055\u308c\u305f\u30d3\u30e5\u30fc\u3092\u4f5c\u6210\u3059\u308b\u554f\u984c\u3067\u3059\u3002<strong><code>AS<\/code> \u4ee5\u964d\u306b <code>SELECT<\/code> \u304c\u51fa\u3066\u304f\u308b\u7406\u7531\u3084\u3001\u305d\u308c\u305e\u308c\u306e\u69cb\u6210\u8981\u7d20\u304c\u4f55\u3092\u610f\u5473\u3057\u3066\u3044\u308b\u306e\u304b<\/strong>\u3092\u3001\u6587\u6cd5\u30fb\u69cb\u6587\u30ec\u30d9\u30eb\u304b\u3089\u4e01\u5be7\u306b\u7d10\u89e3\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u300c\u7d71\u5408\u8cb8\u51fa\u4e88\u7d04\u300d\u3084\u300c\u7d71\u5408\u691c\u7d22\u300d\u3068\u3044\u3063\u305f<strong>\u5b9f\u52d9\u7684\u306a\u7528\u9014\u3068\u7167\u3089\u3057\u5408\u308f\u305b\u305f\u89e3\u91c8<\/strong>\u3082\u7d39\u4ecb\u3057\u306a\u304c\u3089\u3001\u7406\u89e3\u3057\u3065\u3089\u3044\u90e8\u5206\u3092\u4f1a\u8a71\u5f62\u5f0f\u3084\u56f3\u8868\u3067\u308f\u304b\u308a\u3084\u3059\u304f\u88dc\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u300c\u305f\u3060\u6587\u6cd5\u3092\u899a\u3048\u308b\u300d\u306e\u3067\u306f\u306a\u304f\u3001\u300c\u5b9f\u969b\u306b\u3069\u3046\u4f7f\u308f\u308c\u308b\u306e\u304b\u300d\u307e\u3067\u3092\u8996\u91ce\u306b\u5165\u308c\u305f\u6df1\u3044\u7406\u89e3\u3092\u76ee\u6307\u3057\u307e\u3059\u3002<\/p>\n<h2>CREATE VIEW \u306e\u57fa\u672c\u69cb\u6587\u3068 AS\uff0bSELECT \u306e\u610f\u5473\u2502\u5348\u5f8c\u8a66\u9a13\u3067\u554f\u308f\u308c\u308b\u30d3\u30e5\u30fc\u5b9a\u7fa9\u306e\u672c\u8cea<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5348\u5f8c\u8a66\u9a13\u3067\u51fa\u984c\u3055\u308c\u308b\u300c\u30d3\u30e5\u30fc\u5b9a\u7fa9\u300d\u554f\u984c\u3067\u306f\u3001SQL \u306e <code>CREATE VIEW<\/code> \u6587\u304c\u983b\u51fa\u3067\u3059\u3002\u4e2d\u3067\u3082\u3001\u300c<code>AS<\/code> \u306e\u76f4\u5f8c\u306b <code>SELECT<\/code> \u304c\u304f\u308b\u300d\u3068\u3044\u3046\u69cb\u6587\u306b\u6238\u60d1\u3046\u53d7\u9a13\u8005\u304c\u591a\u304f\u3001\u6587\u6cd5\u3060\u3051\u3067\u306a\u304f<strong>\u69cb\u9020\u7684\u306a\u7406\u89e3<\/strong>\u304c\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n<h3>\u25a0 \u30d3\u30e5\u30fc\uff08VIEW\uff09\u3068\u306f\u4f55\u304b\uff1f<\/h3>\n<p>\u30d3\u30e5\u30fc\u3068\u306f\u3001<strong>\u8907\u6570\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u5fc5\u8981\u306a\u5217\u3084\u884c\u3060\u3051\u3092\u53d6\u308a\u51fa\u3057\u3001\u4eee\u60f3\u7684\u306a\u30c6\u30fc\u30d6\u30eb\u3068\u3057\u3066\u6271\u3048\u308b\u4ed5\u7d44\u307f<\/strong>\u3067\u3059\u3002\u5b9f\u969b\u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u304f\u3001SELECT \u6587\u306e\u5b9f\u884c\u7d50\u679c\u3092\u540d\u524d\u4ed8\u304d\u3067\u4fdd\u5b58\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<h3>\u25a0 <code>CREATE VIEW<\/code> \u6587\u306e\u57fa\u672c\u69cb\u6587<\/h3>\n<pre><code>CREATE VIEW \u30d3\u30e5\u30fc\u540d (\u52171, \u52172, ...) AS\nSELECT \u52171, \u52172, ...\nFROM \u30c6\u30fc\u30d6\u30eb\nWHERE \u6761\u4ef6;\n<\/code><\/pre>\n<table border=\"1\">\n<tr>\n<th>\u69cb\u6587\u8981\u7d20<\/th>\n<th>\u610f\u5473<\/th>\n<\/tr>\n<tr>\n<td><code>CREATE VIEW<\/code><\/td>\n<td>\u30d3\u30e5\u30fc\u3092\u4f5c\u6210\u3059\u308b\u30ad\u30fc\u30ef\u30fc\u30c9<\/td>\n<\/tr>\n<tr>\n<td><code>\u30d3\u30e5\u30fc\u540d (\u52171, \u52172, \u2026)<\/code><\/td>\n<td>\u4f5c\u6210\u3059\u308b\u30d3\u30e5\u30fc\u306e\u540d\u524d\u3068\u3001\u305d\u306e\u5217\u540d<\/td>\n<\/tr>\n<tr>\n<td><code>AS<\/code><\/td>\n<td>\u300c\u301c\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u300d\uff1d<strong>SELECT \u306e\u5b9f\u884c\u7d50\u679c\u3068\u3057\u3066<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>SELECT ...<\/code><\/td>\n<td>\u5b9f\u969b\u306b\u53d6\u5f97\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u30c7\u30fc\u30bf\u3002\u30d3\u30e5\u30fc\u306e<strong>\u4e2d\u8eab<\/strong>\u306b\u306a\u308b<\/td>\n<\/tr>\n<\/table>\n<h3>\u25a0 \u306a\u305c AS \u306e\u3042\u3068\u306b SELECT \u304c\u6765\u308b\u306e\uff1f<\/h3>\n<p><strong>&#x1f9d1;&#x200d;&#x1f393;\u300cAS \u306e\u3042\u3068\u306b SELECT \u304c\u7d9a\u304f\u3063\u3066\u3001\u5909\u306a\u611f\u3058\u304c\u3059\u308b\u3093\u3067\u3059\u3051\u3069\u2026\uff1f\u300d<\/strong><br \/>\n<strong>&#x1f468;&#x200d;&#x1f3eb;\u300c\u305d\u308c\u306f\u3001\u201c\u3053\u306e\u30d3\u30e5\u30fc\u306f <em>\u3053\u306eSELECT\u306e\u7d50\u679c<\/em> \u3067\u3067\u304d\u3066\u3044\u307e\u3059\u201d\u3063\u3066\u610f\u5473\u306a\u3093\u3060\u3088\u3002\u300d<\/strong><\/p>\n<p>\u5b9f\u306f <code>AS<\/code> \u306f <strong>\u300c\u301c\u3068\u3057\u3066\u300d<\/strong>\u3068\u3044\u3046\u610f\u5473\u3002<code>CREATE VIEW<\/code> \u6587\u306e\u4e2d\u3067\u306f\u3001<\/p>\n<p><strong>\u3053\u306e\u30d3\u30e5\u30fc\u306f\u300cSELECT \u6587\u306e\u7d50\u679c\u300d\u3092 <em>\u540d\u524d\u3092\u3064\u3051\u3066\u4fdd\u5b58\u3057\u305f\u3082\u306e<\/em>\u3067\u3059\u3088<\/strong><\/p>\n<p>\u3068\u3044\u3046\u5ba3\u8a00\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u25a0 \u56f3\u89e3\u3067\u7406\u89e3\u3059\u308b\uff1a\u5143\u30c6\u30fc\u30d6\u30eb\u3068\u30d3\u30e5\u30fc\u306e\u95a2\u4fc2<\/h3>\n<pre>\n+--------------+         +--------------------+\n| \u66f8\u7c4dA         | JOIN \u2192 |  \u7d71\u5408\u8cb8\u51fa\u4e88\u7d04\u30d3\u30e5\u30fc  |\n|--------------|         |--------------------|\n| \u66f8\u7c4d\u540d       |         | \u8535\u66f8\u756a\u53f7             |\n| \u8457\u8005\u540d       |         | \u66f8\u7c4d\u540d              |\n| \u51fa\u7248\u793e\u540d     |         | \u8457\u8005\u540d              |\n| ISBN\u756a\u53f7     |         | \u51fa\u7248\u793e\u540d            |\n+--------------+         | ISBN\u756a\u53f7           |\n                         | \u56f3\u66f8\u9928\u540d\uff08\u56fa\u5b9a\u6587\u5b57\u5217\uff09|\n                         | \u8cb8\u51fa\u72b6\u6cc1             |\n                         +--------------------+\n<\/pre>\n<h3>\u25a0 \u8868\u3067\u6574\u7406\uff1a\u300c\u5b9f\u30c7\u30fc\u30bf\u300d\u3068\u300c\u30d3\u30e5\u30fc\u306e\u5b9a\u7fa9\u300d\u306e\u9055\u3044<\/h3>\n<table border=\"1\">\n<tr>\n<th>\u9805\u76ee<\/th>\n<th>\u30c6\u30fc\u30d6\u30eb<\/th>\n<th>\u30d3\u30e5\u30fc<\/th>\n<\/tr>\n<tr>\n<td>\u30c7\u30fc\u30bf\u4fdd\u6301<\/td>\n<td>\u3042\u308a\uff08\u7269\u7406\u30c6\u30fc\u30d6\u30eb\uff09<\/td>\n<td>\u306a\u3057\uff08\u4eee\u60f3\u30c6\u30fc\u30d6\u30eb\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u66f4\u65b0\u53ef\u5426<\/td>\n<td>\u53ef<\/td>\n<td>\u901a\u5e38\u306f\u4e0d\u53ef\uff08\u203b\u6761\u4ef6\u4ed8\u304d\u3067\u53ef\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u69cb\u6587\u306b\u5fc5\u8981\u306a\u8981\u7d20<\/td>\n<td>\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9<\/td>\n<td><code>AS SELECT<\/code> \u306b\u3088\u308b\u53d6\u5f97\u5b9a\u7fa9<\/td>\n<\/tr>\n<tr>\n<td>\u5348\u5f8c\u8a66\u9a13\u3067\u306e\u7126\u70b9<\/td>\n<td>\u6b63\u3057\u3044SELECT\u3068JOIN\u69cb\u6587<\/td>\n<td>\u7d50\u679c\u5217\u3068\u5217\u540d\u306e\u5bfe\u5fdc\u4ed8\u3051<\/td>\n<\/tr>\n<\/table>\n<h3>\u25a0 \u4f1a\u8a71\u3067\u518d\u78ba\u8a8d\uff01\u30d3\u30e5\u30fc\u5b9a\u7fa9\u306e\u6b63\u4f53<\/h3>\n<p><strong>&#x1f9d1;&#x200d;&#x1f393;\u300c\u3064\u307e\u308a\u3001AS \u306e\u5f8c\u306b SELECT \u304c\u304f\u308b\u306e\u306f\u3001\u201c\u3053\u306e\u30d3\u30e5\u30fc\u306f\u3053\u308c\u3092\u5143\u306b\u3057\u3066\u308b\u3088\u201d\u3063\u3066\u3053\u3068\u306a\u3093\u3067\u3059\u306d\uff1f\u300d<\/strong><br \/>\n<strong>&#x1f468;&#x200d;&#x1f3eb;\u300c\u305d\u306e\u901a\u308a\uff01\u30d3\u30e5\u30fc\u306f \u201c\u4eee\u306e\u30c6\u30fc\u30d6\u30eb\u201d \u3060\u304b\u3089\u3001\u3069\u306e SELECT \u7d50\u679c\u3092\u4eee\u60f3\u5316\u3059\u308b\u304b\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3093\u3060\u3002\u300d<\/strong><br \/>\n<strong>&#x1f9d1;&#x200d;&#x1f393;\u300cSELECT \u306e\u7d50\u679c\u306b\u540d\u524d\u3092\u3064\u3051\u3066\u3001\u4f55\u5ea6\u3067\u3082\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u306d\uff01\u300d<\/strong><br \/>\n<strong>&#x1f468;&#x200d;&#x1f3eb;\u300c\u307e\u3055\u306b\u305d\u308c\uff01\u5348\u5f8c\u8a66\u9a13\u3067\u306f\u3001\u3053\u306e\u69cb\u9020\u304c\u7406\u89e3\u3067\u304d\u3066\u3044\u308b\u304b\u3092\u554f\u3046\u3066\u304f\u308b\u304b\u3089\u8981\u6ce8\u610f\u3060\u3088\u3002\u300d<\/strong><\/p>\n<h2>\u7d71\u5408\u8cb8\u51fa\u4e88\u7d04\u30d3\u30e5\u30fc\u3092\u8aad\u307f\u89e3\u304f\u2502JOIN\u69cb\u6587\u3068\u56f3\u66f8\u9928\u3054\u3068\u306e\u6761\u4ef6\u8a2d\u5b9a\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n<p>\u5b9f\u969b\u306e\u8a66\u9a13\u554f\u984c\u3067\u306f\u3001A\u5e02\u30fbB\u5e02\u306e\u56f3\u66f8\u9928\u30b7\u30b9\u30c6\u30e0\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u8907\u6570\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6a2a\u65ad\u7684\u306b\u6271\u3046\u300c\u7d71\u5408\u30d3\u30e5\u30fc\u300d\u306e\u5b9a\u7fa9\u304c\u51fa\u984c\u3055\u308c\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u4ee5\u4e0b\u306e SQL \u6587\u3092\u984c\u6750\u306b\u3001\u300c\u3069\u306e\u3088\u3046\u306b\u30d3\u30e5\u30fc\u3092\u7d44\u307f\u7acb\u3066\u308b\u304b\u300d\u300cJOIN \u306e\u76ee\u7684\u300d\u300cWHERE \u6761\u4ef6\u306e\u610f\u5473\u300d\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u25a0 \u30d3\u30e5\u30fc\u4f5c\u6210 SQL\uff1a\u7d71\u5408\u8cb8\u51fa\u4e88\u7d04<\/h3>\n<pre><code>CREATE VIEW \u7d71\u5408\u8cb8\u51fa\u4e88\u7d04\n(\u8535\u66f8\u756a\u53f7, \u66f8\u7c4d\u540d, \u8457\u8005\u540d, \u51fa\u7248\u793e\u540d, ISBN\u756a\u53f7, \u56f3\u66f8\u9928\u540d, \u8cb8\u51fa\u72b6\u6cc1) AS\n\nSELECT \u8535\u66f8A.\u8535\u66f8\u756a\u53f7, \u66f8\u7c4dA.\u66f8\u7c4d\u540d, \u66f8\u7c4dA.\u8457\u8005\u540d, \u66f8\u7c4dA.\u51fa\u7248\u793e\u540d,\n       \u66f8\u7c4dA.ISBN\u756a\u53f7, 'A\u5e02\u56f3\u66f8\u9928', \u8535\u66f8A.\u8cb8\u51fa\u72b6\u6cc1\nFROM \u8535\u66f8A, \u66f8\u7c4dA\nWHERE \u3010a\u3011 AND \u3010f\u3011\n\nUNION\n\nSELECT \u8535\u66f8B.\u8535\u66f8\u756a\u53f7, \u66f8\u7c4dB.\u66f8\u7c4d\u540d, \u8457\u8005\u540d, \u51fa\u7248\u793e\u540d,\n       \u66f8\u7c4dB.ISBN\u756a\u53f7, 'B\u5e02\u56f3\u66f8\u9928', \u8535\u66f8B.\u8cb8\u51fa\u72b6\u6cc1\nFROM \u8535\u66f8B, \u66f8\u7c4dB\nWHERE \u3010d\u3011 AND \u3010g\u3011\n<\/code><\/pre>\n<h3>\u25a0 \u554f\u984c\u6587\u306e\u69cb\u9020\u3092\u628a\u63e1\u3059\u308b\uff1aUNION\u3068JOIN\u306e\u5f79\u5272<\/h3>\n<h4>&#x1f538;UNION \u3068\u306f\uff1f<\/h4>\n<ul>\n<li><code>UNION<\/code> \u306f<strong>2\u3064\u306eSELECT\u6587\u306e\u7d50\u679c\u3092\u7e26\u306b\u7d50\u5408<\/strong>\uff08\u884c\u306e\u8ffd\u52a0\uff09\u3059\u308bSQL\u69cb\u6587\u3002<\/li>\n<li>A\u5e02\u3068 B\u5e02\u306e\u300c\u8cb8\u51fa\u72b6\u6cc1\u30c7\u30fc\u30bf\u300d\u3092<strong>\u3072\u3068\u3064\u306e\u30d3\u30e5\u30fc<\/strong>\u3068\u3057\u3066\u7d71\u5408\u3059\u308b\u76ee\u7684\u3002<\/li>\n<\/ul>\n<h4>&#x1f538;FROM\u53e5\u306b\u8907\u6570\u306e\u30c6\u30fc\u30d6\u30eb\u304c\u3042\u308b\u610f\u5473\u306f\uff1f<\/h4>\n<pre><code>FROM \u8535\u66f8A, \u66f8\u7c4dA<\/code><\/pre>\n<p>\u3053\u308c\u306f\u5b9f\u8cea\u3001<strong>\u6697\u9ed9\u306e\u5185\u90e8\u7d50\u5408\uff08INNER JOIN\uff09<\/strong>\u3067\u3059\u3002<\/p>\n<h3>\u25a0 \u4f1a\u8a71\u3067\u7406\u89e3\u3059\u308b JOIN \u6761\u4ef6\u306e\u672c\u8cea<\/h3>\n<p><strong>&#x1f9d1;&#x200d;&#x1f393;\u300cFROM \u306b2\u3064\u30c6\u30fc\u30d6\u30eb\u540d\u304c\u3042\u308b\u3063\u3066\u3053\u3068\u306f\u3001JOIN \u3057\u3066\u308b\u3063\u3066\u3053\u3068\u3067\u3059\u3088\u306d\uff1f\u300d<\/strong><br \/>\n<strong>&#x1f468;&#x200d;&#x1f3eb;\u300c\u305d\u306e\u901a\u308a\u3002\u305f\u3060\u3057 JOIN \u3059\u308b\u306b\u306f\u3001<em>\u3069\u306e\u5217\u540c\u58eb\u3092\u7d50\u3073\u3064\u3051\u308b\u304b<\/em>\u3092\u660e\u793a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3002\u300d<\/strong><br \/>\n<strong>&#x1f9d1;&#x200d;&#x1f393;\u300c\u305d\u308c\u304c WHERE \u306e\u4e2d\u306e\u3010a\u3011\u3084\u3010d\u3011\u306b\u306a\u308b\u3093\u3067\u3059\u306d\uff01\u300d<\/strong><br \/>\n<strong>&#x1f468;&#x200d;&#x1f3eb;\u300c\u6b63\u89e3\u3002\u305f\u3068\u3048\u3070 A\u5e02\u306a\u3089\uff1a<\/strong><\/p>\n<pre><code>WHERE \u66f8\u7c4dA.\u66f8\u7c4d\u756a\u53f7 = \u8535\u66f8A.\u66f8\u7c4d\u756a\u53f7<\/code><\/pre>\n<p><strong>\u3068\u3044\u3046\u7d50\u3073\u3064\u304d\u304c\u5fc5\u8981\u306a\u3093\u3060\u3002\u300d<\/strong><\/p>\n<h3>\u25a0 \u8868\u3067\u6574\u7406\uff1aA\u5e02\u3068B\u5e02\u306e\u7d50\u5408\u6761\u4ef6\u306e\u9055\u3044<\/h3>\n<table border=\"1\">\n<tr>\n<th>\u6761\u4ef6\u756a\u53f7<\/th>\n<th>\u7d50\u5408\u6761\u4ef6\uff08WHERE\uff09<\/th>\n<th>\u610f\u5473<\/th>\n<\/tr>\n<tr>\n<td>a<\/td>\n<td><code>\u66f8\u7c4dA.\u66f8\u7c4d\u756a\u53f7 = \u8535\u66f8A.\u66f8\u7c4d\u756a\u53f7<\/code><\/td>\n<td>A\u5e02\u306e\u8535\u66f8\u3068\u66f8\u7c4d\u3092\u66f8\u7c4d\u756a\u53f7\u3067\u7d50\u5408<\/td>\n<\/tr>\n<tr>\n<td>d<\/td>\n<td><code>\u66f8\u7c4dB.ISBN\u756a\u53f7 = \u8535\u66f8B.ISBN\u756a\u53f7<\/code><\/td>\n<td>B\u5e02\u306fISBN\u3067\u7d50\u5408<\/td>\n<\/tr>\n<tr>\n<td>f \/ g<\/td>\n<td><code>\u8535\u66f8X.\u8cb8\u51fa\u72b6\u6cc1 IS NOT NULL<\/code> \u306a\u3069<\/td>\n<td>\u8cb8\u51fa\u4e2d\u66f8\u7c4d\u306b\u9650\u5b9a\u3059\u308b\u305f\u3081\u306e\u6761\u4ef6<\/td>\n<\/tr>\n<\/table>\n<h3>\u25a0 \u56f3\u3067\u7406\u89e3\uff1a\u30d3\u30e5\u30fc\u7d71\u5408\u306e\u30a4\u30e1\u30fc\u30b8\u56f3<\/h3>\n<pre>\n[ \u8535\u66f8A ]    [ \u66f8\u7c4dA ]     \u2192  JOIN\uff08\u66f8\u7c4d\u756a\u53f7\uff09\n     \u2193              \u2193\n +-------------------------+\n | \u7d71\u5408\u8cb8\u51fa\u4e88\u7d04\u30d3\u30e5\u30fc\uff08A\u5e02\uff09 |\n +-------------------------+\n\n[ \u8535\u66f8B ]    [ \u66f8\u7c4dB ]     \u2192  JOIN\uff08ISBN\u756a\u53f7\uff09\n     \u2193              \u2193\n +-------------------------+\n | \u7d71\u5408\u8cb8\u51fa\u4e88\u7d04\u30d3\u30e5\u30fc\uff08B\u5e02\uff09 |\n +-------------------------+\n\n     \u2193 UNION\n\n +--------------------------+\n | \u7d71\u5408\u8cb8\u51fa\u4e88\u7d04\u30d3\u30e5\u30fc\uff08\u5171\u901a\uff09 |\n +--------------------------+\n<\/pre>\n<h3>\u25a0 \u307e\u3068\u3081\uff1a\u5348\u5f8c\u8a66\u9a13\u3067\u554f\u308f\u308c\u308b\u300c\u30d3\u30e5\u30fc\uff0b\u6761\u4ef6\u8a2d\u5b9a\u300d\u306e\u8aad\u307f\u65b9<\/h3>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u300c\u8907\u6570\u30c6\u30fc\u30d6\u30eb\u306eJOIN\u300d\u3068\u300c\u30d3\u30e5\u30fc\u306b\u3088\u308b\u7d71\u4e00\u8868\u793a\u300d\u306f\u3001\u5b9f\u52d9\u3067\u3082\u3088\u304f\u4f7f\u308f\u308c\u308b\u6280\u8853\u3067\u3059\u3002\u5348\u5f8c\u8a66\u9a13\u3067\u306f\u300cJOIN\u306e\u6b63\u3057\u3055\u300d\u300c\u6761\u4ef6\u8a2d\u5b9a\u306e\u610f\u56f3\u300d\u304c\u30bb\u30c3\u30c8\u3067\u554f\u308f\u308c\u307e\u3059\u3002<\/p>\n<p>\u7279\u306b\uff1a<\/p>\n<ul>\n<li><strong>A\u5e02\u3068B\u5e02\u306e\u9055\u3044<\/strong>\uff08\u7d50\u5408\u30ad\u30fc\u304c\u66f8\u7c4d\u756a\u53f7 or ISBN\uff09<\/li>\n<li><strong>\u56f3\u66f8\u9928\u540d\u306e\u56fa\u5b9a\u5024<\/strong>\uff08&#8217;A\u5e02\u56f3\u66f8\u9928&#8217; \u306a\u3069\uff09<\/li>\n<li><strong>\u8cb8\u51fa\u72b6\u6cc1\u306b\u3088\u308b\u7d5e\u308a\u8fbc\u307f<\/strong><\/li>\n<\/ul>\n<p>\u3092\u62bc\u3055\u3048\u308b\u3053\u3068\u3067\u3001SQL\u6587\u5168\u4f53\u306e\u69cb\u9020\u3092\u3064\u304b\u307f\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30d3\u30e5\u30fc\u5b9a\u7fa9\u3067\u554f\u308f\u308c\u308b\u5217\u540d\u306e\u5bfe\u5fdc\u3068AS\u306e\u5225\u7528\u6cd5\u2502SELECT\u5185\u306eAS\u3068CREATE VIEW\u3068\u306e\u9055\u3044<\/h2>\n<p><code>CREATE VIEW<\/code> \u6587\u3067\u306e\u51fa\u984c\u3067\u306f\u3001<strong>\u5217\u540d\u306e\u5bfe\u5fdc\u95a2\u4fc2<\/strong>\u3084 <code>AS<\/code> \u306e\u4f7f\u3044\u5206\u3051\u306b\u95a2\u3059\u308b\u7406\u89e3\u304c\u554f\u308f\u308c\u307e\u3059\u3002\u7279\u306b\u6df7\u4e71\u3057\u3084\u3059\u3044\u306e\u304c\u3001\u300c\u30d3\u30e5\u30fc\u5b9a\u7fa9\u306e\u5148\u982d\u306b\u3042\u308b\u5217\u540d\u306e\u4e26\u3073\u300d\u3068\u300cSELECT\u6587\u5185\u306eAS\u306b\u3088\u308b\u5225\u540d\u300d\u306e\u9055\u3044\u3067\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u305d\u308c\u3089\u3092\u533a\u5225\u3057\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<h3>\u25a0 CREATE VIEW \u306e\u5217\u540d\u6307\u5b9a\u306f\u300c\u5916\u5074\u300d\u3001SELECT \u306e AS \u306f\u300c\u5185\u5074\u300d<\/h3>\n<pre><code>CREATE VIEW \u7d71\u5408\u30d3\u30e5\u30fc (\u8535\u66f8\u756a\u53f7, \u66f8\u7c4d\u540d, \u8457\u8005\u540d) AS\nSELECT a.id, b.title, b.writer\nFROM \u8535\u66f8 a, \u66f8\u7c4d b\nWHERE a.book_id = b.book_id;\n<\/code><\/pre>\n<table border=\"1\">\n<tr>\n<th>\u30d3\u30e5\u30fc\u306e\u5217\u540d\uff08CREATE VIEW\uff09<\/th>\n<th>SELECT\u53e5\u306e\u30ab\u30e9\u30e0<\/th>\n<th>\u610f\u5473<\/th>\n<\/tr>\n<tr>\n<td>\u8535\u66f8\u756a\u53f7<\/td>\n<td>a.id<\/td>\n<td>\u30d3\u30e5\u30fc\u3067\u306e\u8868\u793a\u540d\u306f\u5909\u3048\u3066\u3042\u308b<\/td>\n<\/tr>\n<tr>\n<td>\u66f8\u7c4d\u540d<\/td>\n<td>b.title<\/td>\n<td>\u5217\u306e\u610f\u5473\u306f\u5909\u3048\u305a\u306b\u540d\u524d\u3060\u3051\u5909\u66f4<\/td>\n<\/tr>\n<tr>\n<td>\u8457\u8005\u540d<\/td>\n<td>b.writer<\/td>\n<td>SELECT\u3067\u5f97\u305f\u5217\u306b\u30d3\u30e5\u30fc\u7528\u306e\u5217\u540d\u3092\u4ed8\u4e0e<\/td>\n<\/tr>\n<\/table>\n<h3>\u25a0 \u4f1a\u8a71\u3067\u7406\u89e3\u3059\u308b\uff1aAS \u306e2\u7a2e\u985e<\/h3>\n<table border=\"1\">\n<tr>\n<th>\u7528\u9014<\/th>\n<th>\u66f8\u304d\u65b9<\/th>\n<th>\u4f7f\u3046\u5834\u9762<\/th>\n<\/tr>\n<tr>\n<td>\u30d3\u30e5\u30fc\u5b9a\u7fa9<\/td>\n<td><code>CREATE VIEW \u30d3\u30e5\u30fc\u540d (\u5217\u540dA, \u5217\u540dB)<\/code><\/td>\n<td>\u30d3\u30e5\u30fc\u5168\u4f53\u306e\u5217\u540d\u3092\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>\u5225\u540d\u4ed8\u3051<\/td>\n<td><code>SELECT \u5217\u540d AS \u5225\u540d<\/code><\/td>\n<td>\u7d50\u679c\u306b\u8868\u793a\u3059\u308b\u5217\u540d\u3092\u5909\u66f4<\/td>\n<\/tr>\n<\/table>\n<p><strong>&#x1f9d1;&#x200d;&#x1f393;\u300c\u3058\u3083\u3042\u3001\u30d3\u30e5\u30fc\u306e\u5192\u982d\u3067\u5217\u540d\u3092\u6c7a\u3081\u3066\u3001SELECT\u53e5\u3067\u306f\u5217\u306e\u201c\u4e2d\u8eab\u201d\u3092\u9078\u3076\u3063\u3066\u3053\u3068\u3067\u3059\u304b\uff1f\u300d<\/strong><br \/>\n<strong>&#x1f468;&#x200d;&#x1f3eb;\u300c\u305d\u306e\u901a\u308a\uff01SELECT\u6587\u3067\u5225\u540d\u3092\u3064\u3051\u308b\u3068\u304d\u306f\u3001\u201c\u30d3\u30e5\u30fc\u306e\u4e2d\u8eab\u201d\u3092\u52a0\u5de5\u3057\u3066\u308b\u611f\u3058\u3002\u30d3\u30e5\u30fc\u306e\u5217\u540d\u306f\u3001\u201c\u5916\u304b\u3089\u898b\u305f\u3068\u304d\u306e\u9854\u201d\u3092\u6c7a\u3081\u3066\u308b\u3093\u3060\u3088\u3002\u300d<\/strong><\/p>\n<h3>\u25a0 \u5348\u5f8c\u8a66\u9a13\u3067\u3088\u304f\u51fa\u308b\uff01\u5217\u9806\u30df\u30b9\u306e\u843d\u3068\u3057\u7a74<\/h3>\n<pre><code>CREATE VIEW \u7d71\u5408\u30d3\u30e5\u30fc (\u8457\u8005\u540d, \u66f8\u7c4d\u540d, \u8535\u66f8\u756a\u53f7) AS\nSELECT \u8535\u66f8.\u8535\u66f8\u756a\u53f7, \u66f8\u7c4d.\u66f8\u7c4d\u540d, \u66f8\u7c4d.\u8457\u8005\u540d ...\n<\/code><\/pre>\n<p>\u2192 \u8868\u793a\u3055\u308c\u308b\u30d3\u30e5\u30fc\u306e\u300c\u5217\u306e\u9806\u756a\u300d\u304c\u5b9a\u7fa9\u3068\u4e00\u81f4\u3057\u306a\u304f\u306a\u308b\uff01<\/p>\n<h3>\u25a0 \u56f3\u3067\u78ba\u8a8d\uff1a\u5217\u306e\u4e26\u3073\u3068\u5225\u540d\u306e\u95a2\u4fc2<\/h3>\n<pre>\nCREATE VIEW \u7d71\u5408\u30d3\u30e5\u30fc (\u2460, \u2461, \u2462) AS\n                        \u2193   \u2193   \u2193\n              SELECT x, y, z FROM ...\n<\/pre>\n<h3>\u25a0 \u307e\u3068\u3081\uff1aAS \u306f\u300c\u4e2d\u8eab\u306e\u5225\u540d\u300d\u3001\u30d3\u30e5\u30fc\u540d\u306f\u300c\u5916\u306e\u9854\u300d<\/h3>\n<table border=\"1\">\n<tr>\n<th>\u9805\u76ee<\/th>\n<th>CREATE VIEW<\/th>\n<th>SELECT\u53e5\u306eAS<\/th>\n<\/tr>\n<tr>\n<td>\u5217\u540d\u306e\u5f79\u5272<\/td>\n<td>\u30d3\u30e5\u30fc\u306e\u300c\u8868\u5411\u304d\u306e\u5217\u540d\u300d<\/td>\n<td>\u5185\u90e8\u306e\u5217\u306e\u4e00\u6642\u7684\u306a\u5225\u540d<\/td>\n<\/tr>\n<tr>\n<td>\u512a\u5148\u3055\u308c\u308b\u306e\u306f\uff1f<\/td>\n<td>CREATE VIEW \u306e\u5217\u540d<\/td>\n<td>AS \u3067\u6307\u5b9a\u3057\u3066\u3082\u30d3\u30e5\u30fc\u306b\u306f\u53cd\u6620\u3055\u308c\u306a\u3044<\/td>\n<\/tr>\n<tr>\n<td>\u6ce8\u610f\u70b9<\/td>\n<td>\u5217\u9806\u306e\u4e00\u81f4\u304c\u5fc5\u9808<\/td>\n<td>\u610f\u5473\u304c\u4f1d\u308f\u308b\u5225\u540d\u306a\u3089\u554f\u984c\u306a\u3057<\/td>\n<\/tr>\n<\/table>\n<h2>\u30d3\u30e5\u30fc\u5b9a\u7fa9\u3068\u5b9f\u52d9\u6d3b\u7528\u306e\u3064\u306a\u304c\u308a\u2502\u691c\u7d22\u52b9\u7387\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u306e\u89b3\u70b9\u304b\u3089<\/h2>\n<p>\u5348\u5f8c\u8a66\u9a13\u3067\u306f\u3001SQL \u6587\u306e\u6b63\u78ba\u3055\u306b\u52a0\u3048\u3066\u300c\u306a\u305c\u30d3\u30e5\u30fc\u3092\u4f7f\u3046\u306e\u304b\uff1f\u300d\u3068\u3044\u3046\u80cc\u666f\u77e5\u8b58\u304c\u554f\u308f\u308c\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001<strong>\u30d3\u30e5\u30fc\u306e\u5b9f\u52d9\u7684\u306a\u6d3b\u7528\u65b9\u6cd5<\/strong>\u3092\u3001\u691c\u7d22\u52b9\u7387\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u306e\u89b3\u70b9\u304b\u3089\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<h3>\u25a0 \u5b9f\u52d9\u3067\u306f\u300c\u898b\u305b\u305f\u3044\u60c5\u5831\u3060\u3051\u3092\u30d3\u30e5\u30fc\u3067\u5207\u308a\u51fa\u3059\u300d<\/h3>\n<table border=\"1\">\n<tr>\n<th>\u4f7f\u7528\u8005<\/th>\n<th>\u5fc5\u8981\u306a\u60c5\u5831<\/th>\n<th>\u30d3\u30e5\u30fc\u306e\u76ee\u7684<\/th>\n<\/tr>\n<tr>\n<td>\u4e00\u822c\u8077\u54e1<\/td>\n<td>\u66f8\u7c4d\u540d\u30fb\u8cb8\u51fa\u72b6\u6cc1\u306e\u307f<\/td>\n<td>\u8457\u8005\u3084ISBN\u306f\u975e\u516c\u958b<\/td>\n<\/tr>\n<tr>\n<td>\u7ba1\u7406\u8005<\/td>\n<td>\u5168\u9805\u76ee<\/td>\n<td>\u5168\u30c7\u30fc\u30bf\u306e\u7d71\u5408\u30d3\u30e5\u30fc<\/td>\n<\/tr>\n<tr>\n<td>\u5916\u90e8\u30b7\u30b9\u30c6\u30e0<\/td>\n<td>\u66f8\u7c4d\u540d\uff0b\u8cb8\u51fa\u72b6\u6cc1<\/td>\n<td>\u5185\u90e8ID\u306a\u3069\u306f\u9664\u5916<\/td>\n<\/tr>\n<\/table>\n<h3>\u25a0 \u4f1a\u8a71\u3067\u7406\u89e3\uff1a\u30d3\u30e5\u30fc\u306f\u300c\u898b\u305b\u305f\u3044\u90e8\u5206\u3060\u3051\u306e\u7a93\u300d<\/h3>\n<p><strong>&#x1f9d1;&#x200d;&#x1f393;\u300c\u30d3\u30e5\u30fc\u3063\u3066\u3001\u305f\u3060\u306eSELECT\u6587\u3058\u3083\u306a\u3044\u3093\u3067\u3059\u304b\uff1f\u300d<\/strong><br \/>\n<strong>&#x1f468;&#x200d;&#x1f3eb;\u300c\u5b9f\u306f\u305d\u308c\u4ee5\u4e0a\u306e\u610f\u5473\u304c\u3042\u308b\u3093\u3060\u3002\u305f\u3068\u3048\u3070 \u201c\u672c\u68da\u306b\u30ab\u30fc\u30c6\u30f3\u3092\u304b\u3051\u3066\u3001\u7279\u5b9a\u306e\u68da\u3060\u3051\u898b\u305b\u308b\u201d \u307f\u305f\u3044\u306a\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3002\u300d<\/strong><br \/>\n<strong>&#x1f9d1;&#x200d;&#x1f393;\u300c\u306a\u308b\u307b\u3069\u3001\u30d3\u30e5\u30fc\u3092\u4f7f\u3048\u3070\u3001\u201c\u898b\u305b\u305f\u3044\u5217\u30fb\u884c\u3060\u3051\u201d \u516c\u958b\u3067\u304d\u308b\u3063\u3066\u3053\u3068\u3067\u3059\u306d\uff01\u300d<\/strong><br \/>\n<strong>&#x1f468;&#x200d;&#x1f3eb;\u300c\u305d\u3046\uff01\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u3082\u3001\u91cd\u8981\u306a\u5217\u3084\u500b\u4eba\u60c5\u5831\u3092\u96a0\u305b\u308b\u304b\u3089\u91cd\u5b9d\u3055\u308c\u3066\u308b\u3093\u3060\u3002\u300d<\/strong><\/p>\n<h3>\u25a0 \u56f3\u89e3\uff1a\u7269\u7406\u30c6\u30fc\u30d6\u30eb vs \u30d3\u30e5\u30fc\u306e\u30a4\u30e1\u30fc\u30b8<\/h3>\n<pre>\n[ \u66f8\u7c4d\u30c6\u30fc\u30d6\u30eb ]\n+--------+--------+----------+--------+\n| \u66f8\u7c4dID | \u66f8\u7c4d\u540d | \u8457\u8005     | ISBN   |\n+--------+--------+----------+--------+\n   \u2193\n\n[ \u7ba1\u7406\u8005\u30d3\u30e5\u30fc ]\n\u2192 \u66f8\u7c4dID\u3001\u66f8\u7c4d\u540d\u3001\u8457\u8005\u3001ISBN\uff08\u5168\u90e8\u898b\u3048\u308b\uff09\n\n[ \u8077\u54e1\u30d3\u30e5\u30fc ]\n\u2192 \u66f8\u7c4d\u540d\u3001\u8cb8\u51fa\u72b6\u6cc1\u306e\u307f\uff08\u8457\u8005\u3084ISBN\u306f\u96a0\u3059\uff09\n\n[ \u5916\u90e8\u30d3\u30e5\u30fc ]\n\u2192 \u66f8\u7c4d\u540d\uff0b\u8cb8\u51fa\u72b6\u6cc1\uff0b\u56fa\u5b9a\u6587\u5b57\u5217\u300c\u516c\u5171\u8535\u66f8\u300d\u306a\u3069\n<\/pre>\n<h3>\u25a0 \u30d3\u30e5\u30fc\u306e\u6d3b\u7528\u4f8b\uff1a\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u5229\u4fbf\u6027\u306e\u4e21\u7acb<\/h3>\n<table border=\"1\">\n<tr>\n<th>\u6d3b\u7528\u4f8b<\/th>\n<th>\u5185\u5bb9<\/th>\n<\/tr>\n<tr>\n<td>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56<\/td>\n<td>\u4e0d\u8981\u306a\u5217\u3084\u500b\u4eba\u60c5\u5831\u3092 SELECT \u6587\u3067\u9664\u5916\u3057\u3001\u30d3\u30e5\u30fc\u7d4c\u7531\u306e\u30a2\u30af\u30bb\u30b9\u5236\u9650<\/td>\n<\/tr>\n<tr>\n<td>\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027<\/td>\n<td>\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u304c\u5909\u308f\u3063\u3066\u3082\u3001\u30d3\u30e5\u30fc\u3092\u4ecb\u305b\u3070\u65e2\u5b58\u30a2\u30d7\u30ea\u306f\u5f71\u97ff\u3092\u53d7\u3051\u306b\u304f\u3044<\/td>\n<\/tr>\n<tr>\n<td>\u691c\u7d22\u52b9\u7387<\/td>\n<td>\u8907\u96d1\u306aJOIN\u3092\u3042\u3089\u304b\u3058\u3081\u5b9a\u7fa9\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u518d\u5229\u7528\u6027\u304c\u5411\u4e0a<\/td>\n<\/tr>\n<\/table>\n<h3>\u25a0 \u5348\u5f8c\u8a66\u9a13\u3067\u554f\u308f\u308c\u308b\u300c\u30d3\u30e5\u30fc\u3092\u4f7f\u3046\u7406\u7531\u300d<\/h3>\n<p>\u51fa\u984c\u8005\u306f\u3001\u5358\u306bSQL\u3092\u66f8\u3051\u308b\u304b\u3060\u3051\u3067\u306a\u304f\uff1a<\/p>\n<ul>\n<li><strong>\u306a\u305c\u30d3\u30e5\u30fc\u306b\u5206\u3051\u3066\u3044\u308b\u306e\u304b\uff1f<\/strong><\/li>\n<li><strong>\u8ab0\u304c\u3053\u306e\u30d3\u30e5\u30fc\u3092\u4f7f\u3046\u306e\u304b\uff1f<\/strong><\/li>\n<li><strong>\u3069\u3046\u3044\u3046\u9805\u76ee\u304c\u5fc5\u8981\u3067\u3001\u3069\u308c\u304c\u4e0d\u8981\u304b\uff1f<\/strong><\/li>\n<\/ul>\n<p>\u3068\u3044\u3063\u305f\u5b9f\u52d9\u7684\u306a\u8996\u70b9\u3067\u8a2d\u554f\u3092\u69cb\u6210\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u300c\u30d3\u30e5\u30fc\u306e\u610f\u7fa9\u300d\u3092\u7406\u89e3\u3057\u3066\u304a\u304f\u3068\u3001\u8a18\u8ff0\u554f\u984c\u3067\u3082\u5bfe\u5fdc\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>CREATE VIEW \u306e\u69cb\u9020\u3068\u5b9f\u52d9\u7684\u306a\u8996\u70b9\u3092\u62bc\u3055\u3048\u3066\u5348\u5f8c\u8a66\u9a13\u3092\u653b\u7565\u3057\u3088\u3046<\/h2>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001<code>CREATE VIEW<\/code> \u306b\u95a2\u3059\u308b\u5348\u5f8c\u8a66\u9a13\u306e\u51fa\u984c\u30d1\u30bf\u30fc\u30f3\u3092\u901a\u3058\u3066\u3001\u69cb\u6587\u306e\u4ed5\u7d44\u307f\u304b\u3089\u5b9f\u52d9\u7684\u306a\u80cc\u666f\u307e\u3067\u3092\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002\u7279\u306b\u6b21\u306e\u30dd\u30a4\u30f3\u30c8\u3092\u62bc\u3055\u3048\u3066\u304a\u304f\u3053\u3068\u304c\u3001\u5348\u5f8c\u8a66\u9a13\u653b\u7565\u306e\u9375\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>&#x2705; \u8a66\u9a13\u5bfe\u7b56\u3068\u3057\u3066\u306e\u8981\u70b9\u307e\u3068\u3081<\/h3>\n<ul>\n<li><strong>AS\uff0bSELECT\u306e\u610f\u5473\uff1a<\/strong> \u300c\u3053\u306e\u30d3\u30e5\u30fc\u306f\u3053\u306eSELECT\u7d50\u679c\u304b\u3089\u3067\u304d\u3066\u3044\u308b\u300d\u3068\u3044\u3046\u69cb\u6587\u7684\u5ba3\u8a00<\/li>\n<li><strong>UNION\uff0bJOIN\u306e\u6d3b\u7528\uff1a<\/strong> \u8907\u6570\u306e\u30c6\u30fc\u30d6\u30eb\u30fb\u81ea\u6cbb\u4f53\u30c7\u30fc\u30bf\u3092\u7d71\u5408\u7684\u306b\u6271\u3046\u305f\u3081\u306e\u4ed5\u7d44\u307f<\/li>\n<li><strong>\u5217\u540d\u306e\u5bfe\u5fdc\u95a2\u4fc2\uff1a<\/strong> CREATE VIEW\u306e\u5217\u9806\u3068SELECT\u53e5\u306e\u51fa\u529b\u9806\u3092\u4e00\u81f4\u3055\u305b\u308b<\/li>\n<li><strong>\u5b9f\u52d9\u3078\u306e\u5fdc\u7528\uff1a<\/strong> \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30fb\u30e1\u30f3\u30c6\u6027\u30fb\u691c\u7d22\u52b9\u7387\u306e\u89b3\u70b9\u304b\u3089\u30d3\u30e5\u30fc\u304c\u4f7f\u308f\u308c\u308b<\/li>\n<\/ul>\n<h3>&#x2705; \u5348\u5f8c\u554f\u984c\u306b\u5411\u3051\u305f\u5b66\u7fd2\u30a2\u30d7\u30ed\u30fc\u30c1<\/h3>\n<ul>\n<li>SQL \u69cb\u6587\u306e\u6697\u8a18\u306b\u3068\u3069\u307e\u3089\u305a\u3001<strong>\u300c\u306a\u305c\u305d\u306e\u69cb\u6587\u304c\u5fc5\u8981\u306a\u306e\u304b\u300d<\/strong>\u3092\u5e38\u306b\u610f\u8b58\u3059\u308b<\/li>\n<li><strong>\u5b9f\u30c7\u30fc\u30bf\u306e\u3064\u306a\u304c\u308a\u3084\u696d\u52d9\u3067\u306e\u610f\u5473<\/strong>\u3092\u60f3\u50cf\u3057\u306a\u304c\u3089\u8aad\u3080\u3053\u3068\u3067\u3001\u7406\u89e3\u304c\u6df1\u307e\u308b<\/li>\n<li>\u56f3\u3084\u8868\u3092\u4f7f\u3063\u3066<strong>\u69cb\u9020\u306e\u5bfe\u5fdc\u95a2\u4fc2<\/strong>\u3092\u8996\u899a\u7684\u306b\u62bc\u3055\u3048\u308b\u3068\u3001\u8a18\u8ff0\u5f0f\u554f\u984c\u306b\u3082\u5f37\u304f\u306a\u308b<\/li>\n<\/ul>\n<p>\u5348\u5f8c\u554f\u984c\u3067\u306f\u3001\u300c\u69cb\u6587\u306e\u6b63\u3057\u3055\u300d\u3060\u3051\u3067\u306a\u304f\u3001\u300c\u696d\u52d9\u3067\u3069\u3046\u4f7f\u308f\u308c\u308b\u304b\u300d\u306e\u8996\u70b9\u3082\u6c42\u3081\u3089\u308c\u307e\u3059\u3002\u4eca\u56de\u306e\u3088\u3046\u306a\u8996\u70b9\u3092\u6301\u3061\u306a\u304c\u3089\u5b66\u7fd2\u3059\u308c\u3070\u3001CREATE VIEW \u306e\u554f\u984c\u306f\u5927\u304d\u306a\u5f97\u70b9\u6e90\u306b\u306a\u308a\u307e\u3059\u3002\u3057\u3063\u304b\u308a\u653b\u7565\u3057\u3066\u5f97\u70b9\u30a2\u30c3\u30d7\u3092\u72d9\u3044\u307e\u3057\u3087\u3046\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5348\u5f8c\u8a66\u9a13\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5206\u91ce\u3067\u306f\u3001\u300cCREATE VIEW\u300d\u6587\u3092\u4f7f\u3063\u305f\u30d3\u30e5\u30fc\u5b9a\u7fa9\u306e\u554f\u984c\u304c\u983b\u51fa\u3067\u3059\u3002\u7279\u306b\u3001\u300cAS \u306e\u5f8c\u308d\u306b SELECT \u6587\u304c\u76f4\u63a5\u7d9a\u304f\u69cb\u6587\u300d\u306b\u5bfe\u3057\u3066\u9055\u548c\u611f\u3084\u6238\u60d1\u3044\u3092\u899a\u3048\u308b\u53d7\u9a13\u8005\u306f\u591a\u304f\u3001\u51fa\u984c &#8230; <\/p>\n","protected":false},"author":2,"featured_media":5483,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","columnck":"","stmeta_robots":"index, follow","st_titlewords":"","st_title_extra":"","st_keywords":"","st_description":"","st_display_ad_mark":"","st_display_ad_mark_hide":"","textcopyck":"","st_copyright":"","st_copyurl":"","eyecatch_set":"","st_youtube_url":"","st_youtube_eyecatch":"","headerwidget_set":"","updatewidget_set":"","kanrenwidget_set":"","ikkatuwidget_set":"","koukoku_set":"","auto_adsense_koukoku_set":"","st_redirect":"","st_redirect_url_as_canonical":"","st_redirect_pvm_do_not_track":"","post_data_updatewidget_set":"","st_post_header_under_bg":"","st_twitter_tag":"","affinger_note":"","rankdisplayck":"","st_head_code":"","st_footer_code":"","st_post_header_under_code":"","_st_toc_override":false,"_st_toc_settings":[]},"categories":[3],"tags":[6],"class_list":["post-5480","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ipa","tag-6"],"_links":{"self":[{"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/posts\/5480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/comments?post=5480"}],"version-history":[{"count":0,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/posts\/5480\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/media\/5483"}],"wp:attachment":[{"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/media?parent=5480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/categories?post=5480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sky-peace.net\/certified\/wp-json\/wp\/v2\/tags?post=5480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}