{"id":2182,"date":"2018-05-03T19:00:59","date_gmt":"2018-05-03T10:00:59","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=2182"},"modified":"2023-05-19T23:00:13","modified_gmt":"2023-05-19T14:00:13","slug":"%e3%80%90sql%e3%80%91%e3%83%92%e3%83%b3%e3%83%88%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=2182","title":{"rendered":"\u3010SQL\u3011\u30d2\u30f3\u30c8\u53e5\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306f\u3001SQL\u3092\u89e3\u6790\u3057\u3066\u3001\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u300c\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u300d<\/strong><\/span>\u306b\u3064\u3044\u3066\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"SxNYdKlbXD\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=2162\">\u3010Oracle\u3011\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u3068\u306f\uff1f<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=2162&#038;embed=true#?secret=SxNYdKlbXD\" data-secret=\"SxNYdKlbXD\" width=\"500\" height=\"282\" title=\"&#8220;\u3010Oracle\u3011\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u3068\u306f\uff1f&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u3057\u304b\u3057\u3001<span style=\"color: #ff0000;\"><strong>\u610f\u56f3\u3057\u305f\u3068\u304a\u308a\u306e\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u306a\u3044\u30b1\u30fc\u30b9<\/strong><\/span>\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u969b\u306b\u4f7f\u7528\u3059\u308b\u306e\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u30d2\u30f3\u30c8\u53e5\u300d<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306f\u3069\u306e\u3088\u3046\u306a\u6642\u306b\u6700\u9069\u306a\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u3063\u3066\u304f\u308c\u306a\u3044\uff1f<\/h2>\n<ul>\n<li>\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u7d71\u8a08\u304c\u53e4\u304f\u3066\u5b9f\u614b\u3068\u304b\u3051\u96e2\u308c\u3066\u3044\u308b\u5834\u5408<\/li>\n<li>\u8907\u96d1\u3059\u304e\u308bSQL\u306e\u5834\u5408\uff08\u7d50\u5408\u304c5\u3064\u4ee5\u4e0a\u3042\u308b\u3088\u3046\u306a\uff09<\/li>\n<\/ul>\n<h2>\u30d2\u30f3\u30c8\u53e5\u3068\u306f\u3069\u306e\u3088\u3046\u306a\u3082\u306e\u304b\uff1f<\/h2>\n<p>\u3042\u3089\u304b\u3058\u3081\u3001SQL\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u7d71\u8a08\u60c5\u5831\u304c\u5b8c\u5168\u306b\u53d6\u5f97\u3067\u304d\u3066\u306a\u3044\u5834\u5408\u3067\u3082\u3001\u6700\u9069\u306a\u5b9f\u884c\u8a08\u753b\u306b\u306a\u308b\u3088\u3046\u306b\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u3092\u5c0e\u304d\u307e\u3059\u3002<\/strong><\/span><\/p>\n<h2>\u69cb\u6587<\/h2>\n<pre class=\"lang:default decode:true\">\/*+ \u30d2\u30f3\u30c8\u5185\u5bb9 *\/<\/pre>\n<h3>\u5177\u4f53\u4f8b<\/h3>\n<p>select\u6587\u306eselect\u53e5\u306e\u5f8c\u306a\u3069\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u6307\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066\u6307\u5b9a\u3057\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b9\u30ad\u30e3\u30f3\u3092\u5b9f\u65bd\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">select \/*+ INDEX(users user_id)*\/ * from users<\/pre>\n<p>\u3082\u3057\u3001\u300c\u30c6\u30fc\u30d6\u30eb\u540d as t\u300d\u306a\u3069\u3068\u5225\u540d\u3092\u4f7f\u7528\u3057\u3066\u3044\u305f\u5834\u5408\u306f\u30d2\u30f3\u30c8\u53e5\u306b\u306f\u5225\u540d\u3092\u6307\u5b9a\u3057\u306a\u3044\u3068\u52d5\u304b\u306a\u3044\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002\uff08\u5225\u540d\u3092\u4f7f\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u5b9f\u30c6\u30fc\u30d6\u30eb\u540d\u306e\u6307\u5b9a\u3067\u554f\u984c\u306a\u3044\u3067\u3059\u3002\uff09<\/p>\n<h3>\u30d2\u30f3\u30c8\u306e\u7a2e\u985e<\/h3>\n<table>\n<tbody>\n<tr>\n<th>\u30d2\u30f3\u30c8<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>CHOOSE<\/td>\n<td>\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u30e2\u30fc\u30c9\u3092CHOOSE\u306b\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>RULE<\/td>\n<td>RBO\u56fa\u5b9a\u306b\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>FIRST_ROWS<\/td>\n<td>\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u30e2\u30fc\u30c9\u3092FIRST_ROWS\u306b\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>ALL_ROWS<\/td>\n<td>\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u30e2\u30fc\u30c9\u3092ALL_ROWS\u306b\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>FULL(&lt;\u30c6\u30fc\u30d6\u30eb\u540d&gt;)<\/td>\n<td>\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u30d5\u30eb\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u3092\u884c\u3046\u3002<\/td>\n<\/tr>\n<tr>\n<td>INDEX(&lt;\u30c6\u30fc\u30d6\u30eb\u540d&gt;&lt;\u7d22\u5f15\u540d&gt;)<\/td>\n<td>\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u30a2\u30af\u30bb\u30b9\u306b\u6307\u5b9a\u3055\u308c\u305f\u7d22\u5f15\u3092\u4f7f\u7528\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>INDEX_DESC(&lt;\u30c6\u30fc\u30d6\u30eb\u540d&gt;&lt;\u7d22\u5f15\u540d&gt;)<\/td>\n<td>\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u30a2\u30af\u30bb\u30b9\u306b\u6307\u5b9a\u3055\u308c\u305f\u7d22\u5f15\u3092\u9006\u9806\u306b\u4f7f\u7528\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>USE_NL(&lt;\u30c6\u30fc\u30d6\u30eb\u540d&gt;)<\/td>\n<td>\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u304c\u7d50\u5408\u3055\u308c\u308b\u969b\u306b\u3001\u30cd\u30b9\u30c6\u30c3\u30c9\u30eb\u30fc\u30d7\u7d50\u5408\u3092\u4f7f\u7528\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>USE_MERGE(&lt;\u30c6\u30fc\u30d6\u30eb\u540d&gt;)<\/td>\n<td>\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u304c\u7d50\u5408\u3055\u308c\u308b\u969b\u306b\u3001\u30bd\u30fc\u30c8\/\u30de\u30fc\u30b8\u7d50\u5408\u3092\u4f7f\u7528\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>USE_HASH(&lt;\u30c6\u30fc\u30d6\u30eb\u540d1&gt;&lt;\u30c6\u30fc\u30d6\u30eb\u540d2&gt;)<\/td>\n<td>\u6307\u5b9a\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u304c\u7d50\u5408\u3055\u308c\u308b\u969b\u306b\u3001\u30cf\u30c3\u30b7\u30e5\u7d50\u5408\u3092\u4f7f\u7528\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>ORDERED<\/td>\n<td>FROM\u53e5\u306b\u8a18\u8ff0\u3055\u308c\u305f\u9806\u756a\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308b\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u305f\u304f\u3055\u3093\u3042\u308a\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u3088\u304f\u4f7f\u3046\u30d2\u30f3\u30c8\u53e5\u306f\u305d\u3046\u591a\u304f\u306a\u3044\u3067\u3059\u3002\uff08INDEX\u3001FULL\u3001USE_HASH\u306a\u3069\uff09<\/p>\n<p>\u30d2\u30f3\u30c8\u306e\u4e2d\u306b\u51fa\u3066\u304f\u308b\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30ad\u30e3\u30f3\u300d\u306b\u95a2\u3059\u308b\u7528\u8a9e<\/strong><\/span>\u306b\u3064\u3044\u3066\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"MkxJPN7PQB\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=2170\">\u3010Oracle\u3011\u5b9f\u884c\u8a08\u753b\u4f5c\u6210\u5f8c\u306eSQL\u5b9f\u884c\u6642\u306e\u52d5\u4f5c\u306e\u4ed5\u7d44\u307f\uff08\u30a2\u30af\u30bb\u30b9\u65b9\u6cd5\uff09<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=2170&#038;embed=true#?secret=MkxJPN7PQB\" data-secret=\"MkxJPN7PQB\" width=\"500\" height=\"282\" title=\"&#8220;\u3010Oracle\u3011\u5b9f\u884c\u8a08\u753b\u4f5c\u6210\u5f8c\u306eSQL\u5b9f\u884c\u6642\u306e\u52d5\u4f5c\u306e\u4ed5\u7d44\u307f\uff08\u30a2\u30af\u30bb\u30b9\u65b9\u6cd5\uff09&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u306f\u3001SQL\u3092\u89e3\u6790\u3057\u3066\u3001\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u300c\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u300d\u306b\u3064\u3044\u3066\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002 \u3010Oracle\u3011\u30aa\u30d7\u30c6\u30a3\u30de\u30a4\u30b6\u3068\u306f\uff1f \u3057\u304b\u3057\u3001\u610f\u56f3\u3057\u305f\u3068\u304a\u308a\u306e\u5b9f\u884c\u8a08\u753b\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u306a\u3044\u30b1\u30fc\u30b9\u304c\u3042\u308a [&hellip;]","protected":false},"author":1,"featured_media":2211,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[24],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/2182"}],"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=2182"}],"version-history":[{"count":8,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/2182\/revisions"}],"predecessor-version":[{"id":19707,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/2182\/revisions\/19707"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/2211"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2182"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}