{"id":1179,"date":"2018-12-19T12:00:13","date_gmt":"2018-12-19T03:00:13","guid":{"rendered":"https:\/\/www.bold.ne.jp\/engineer-club\/?p=1179"},"modified":"2025-09-17T14:11:01","modified_gmt":"2025-09-17T05:11:01","slug":"sql-select","status":"publish","type":"post","link":"https:\/\/www.bold.ne.jp\/engineer-club\/sql-select","title":{"rendered":"SQL\u306eSELECT\u6587\u3068\u306f\uff1f\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308bSELECT\u6587\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9"},"content":{"rendered":"<p><strong>SQL\u306e\u4e2d\u306eDML(Data Manipulation Language:\u30c7\u30fc\u30bf\u64cd\u4f5c\u8a00\u8a9e)\u306b\u306f\u3001SELECT(\u62bd\u51fa)\u30fbINSERT(\u633f\u5165)\u30fbUPDATE(\u66f4\u65b0)\u30fbDELETE(\u524a\u9664)\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u306e\u4e2d\u306eSELECT\u6587\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/strong><\/p>\n<p>\u5b9f\u969b<span>SELECT<\/span>\u6587\u3092\u4f7f\u3046\u3068\u304d\u306f\u3001\u8272\u3005\u52a0\u5de5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u307e\u305a\u306f\u3001<span>SELECT<\/span>\u6587\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u899a\u3048\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#SQLSELECT\">\uff11\uff0e\u3010SQL\u3011SELECT\u6587<\/a><ul><li><a href=\"#-SELECT\">\uff11-\uff11\uff0eSELECT\u306e\u57fa\u672c\u7684\u306a\u69cb\u6587<\/a><\/li><li><a href=\"#-SELECT-2\">\uff11-\uff12\uff0eSELECT\u306e\u4f7f\u7528\u4f8b<\/a><\/li><\/ul><\/li><li><a href=\"#SQLDUAL\">\uff12\uff0e\u3010SQL\u3011\u5b9f\u969b\u306e\u5217\u540d\u306e\u5024\u306e\u52a0\u5de5\u5185\u5bb9\u3092\u78ba\u8a8d\uff5e\u899a\u3048\u3066\u304a\u304f\u3068\u4fbf\u5229\u306aDUAL\u8868\uff5e<\/a><\/li><li><a href=\"#i\">\uff13\uff0e\u3055\u3044\u3054\u306b<\/a><\/li><\/ul><\/div>\n<h2><span id=\"SQLSELECT\">\uff11\uff0e\u3010SQL\u3011SELECT\u6587<\/span><\/h2>\n<p>SELECT\u6587\u306f\u3001<span style=\"text-decoration: underline;\">\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u3068\u304d\u306b<\/span>\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u3042\u308b\u30c6\u30fc\u30d6\u30eb<span>(<\/span>\u30c7\u30fc\u30bf\u306e\u96c6\u5408\u4f53<span>)<\/span>\u304b\u3089<strong>\u3069\u306e\u3088\u3046\u306a\u6761\u4ef6\u3067\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3057\u3066\u307b\u3057\u3044\u306e\u304b\u3092\u8868\u3057\u305f\u547d\u4ee4\u6587\u3067\u3059<\/strong>\u3002<\/p>\n<h3><span id=\"-SELECT\">\uff11-\uff11\uff0eSELECT\u306e\u57fa\u672c\u7684\u306a\u69cb\u6587<\/span><\/h3>\n<p>\u57fa\u672c\u7684\u306a\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p><span class=\"f-marker-y\">\u2605\u69cb\u6587<\/span><\/p>\n<blockquote>\n<p>SELECT\u5217\u540d<\/p>\n<p>FROM \u30c6\u30fc\u30d6\u30eb\u540d<span>;<\/span><\/p>\n<\/blockquote>\n<p>SELECT\u6587\u306e\u7d42\u308f\u308a\u306f\u3001\u300c<span>;(<\/span>\u30bb\u30df\u30b3\u30ed\u30f3<span>)<\/span>\u300d\u3092\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u69cb\u6587\u306b<\/p>\n<ul>\n<li>\u8907\u6570\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408<\/li>\n<li>\u5217\u3068\u5217\u3092\u7d50\u5408<\/li>\n<li>\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u3066\u8a08\u7b97<\/li>\n<li>\u5217\u306e\u5024\u3092Excel\u306e\u95a2\u6570\u3068\u540c\u3058\u3088\u3046\u306b\u4f7f\u7528(\u4f8b\u3048\u3070\u3001\u4f55\u6841\u76ee\u304b\u3089\u4f55\u6841\u76ee\u306e\u6587\u5b57\u3092\u53d6\u5f97\u306a\u3069)<\/li>\n<li>\u3069\u306e\u3088\u3046\u306a\u6761\u4ef6\u3067\u30c7\u30fc\u30bf\u3092\u7d5e\u308a\u3053\u3080\u306e\u304b<\/li>\n<li>\u3069\u306e\u9806\u756a\u306b\u30c7\u30fc\u30bf\u3092\u4e26\u3079\u308b\u304b<\/li>\n<\/ul>\n<p>\u306a\u3069\u3055\u307e\u3056\u307e\u306b\u52a0\u5de5\u3092\u3057\u3066<span>SELECT<\/span>\u6587\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30e1\u30fc\u30b8\u306f\u3001<span>Excel<\/span>\u3084<span>Word<\/span>\u306a\u3069\u3067\u4f5c\u6210\u3059\u308b\u300c\u30de\u30c8\u30ea\u30c3\u30af\u8868\u300d\u3067\u3059\u3002<\/p>\n<p><span class=\"f-marker-p\">\u3010\u4f8b\u3011\u793e\u54e1\u8868<\/span><\/p>\n<table border=\"1\" style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u793e\u54e1\u756a\u53f7<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u540d\u524d<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u90e8\u7f72\u540d<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u6027\u5225<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">00001<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u540d\u524d1<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">A\u90e8\u7f72<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u7537\u6027<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">00002<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u540d\u524d2<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">A\u90e8\u7f72<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u5973\u6027<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">00003<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u540d\u524d3<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">B\u90e8\u7f72<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u7537\u6027<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">00004<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u540d\u524d4<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">A\u90e8\u7f72<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u7537\u6027<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">00005<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u540d\u524d5<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">A\u90e8\u7f72<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u5973\u6027<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">00006<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u540d\u524d6<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">B\u90e8\u7f72<\/td>\n<td style=\"width: 25%; text-align: center; border-color: #000000; height: 24px;\">\u7537\u6027<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u300c\u5217\u540d\u300d\u304c\u3001\u7e26\u65b9\u5411\u306e\u300c\u5217\u300d(\u793e\u54e1\u756a\u53f7\u30fb\u540d\u524d\u30fb\u90e8\u7f72\u540d\u30fb\u6027\u5225\uff09<\/p>\n<p>\u300c\u30c6\u30fc\u30d6\u30eb\u300d\u304c\u3001\u300c\u30de\u30c8\u30ea\u30c3\u30af\u30b9\u8868\u300d(\u793e\u54e1\u8868)<\/p>\n<p>\u300c\u30ec\u30b3\u30fc\u30c9\u300d\u304c\u3001\u6a2a\u65b9\u5411\u306e\u300c\u884c\u300d(\u4f8b\u3048\u3070\u300100001\u30fb\u540d\u524d<span>1<\/span>\u30fbA\u90e8\u7f72\u30fb\u7537\u6027)<\/p>\n<h3><span id=\"-SELECT-2\">\uff11-\uff12\uff0eSELECT\u306e\u4f7f\u7528\u4f8b<\/span><\/h3>\n<p>\u307e\u305a\u306f\u3001\u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u306f\u9055\u3044\u307e\u3059\u304c\u3001\u4f8b\u6587\u3092\u901a\u3057\u3066<span>SELECT<\/span>\u6587\u3092\u30a4\u30e1\u30fc\u30b8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><span class=\"f-marker-p\">\u3010\u4f8b\uff11\u3011\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u540d\uff1a\u300c\u793e\u54e1\u756a\u53f7\u300d\u3001\u300c\u540d\u524d\u300d\u3092\u5168\u30c7\u30fc\u30bf\u8868\u793a<\/span><\/p>\n<p><span class=\"f-marker-y\">\u2605\u69cb\u6587<\/span><\/p>\n<blockquote>\n<p>SELECT\u3000\u5217\u540d<span>1,<\/span>\u5217\u540d<span>2, <\/span>\u5217\u540d<span>3<\/span>\u30fb\u30fb\u30fb<\/p>\n<p>FROM\u3000\u30c6\u30fc\u30d6\u30eb\u540d<span>;<\/span><\/p>\n<\/blockquote>\n<p>\u8907\u6570\u306e\u5217\u540d\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3001\u5217\u540d\u9593\u3092\u300c,(\u30ab\u30f3\u30de)\u300d\u3067\u533a\u5207\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT\u793e\u54e1\u756a\u53f7,\u540d\u524d FROM\u793e\u54e1\u8868;<\/pre>\n<p><span class=\"f-marker-g\">\u51fa\u529b\u7d50\u679c<\/span><\/p>\n<pre class=\"prettyprint lang:default decode:true\">\u793e\u54e1\u756a\u53f7      \u540d\u524d\r\n----------------------------------------------------\r\n00001\t    \u540d\u524d1 \r\n00002\t    \u540d\u524d2 \r\n00003\t    \u540d\u524d3 \r\n00004\t    \u540d\u524d4 \r\n00005\t    \u540d\u524d5 \r\n00006\t    \u540d\u524d6<\/pre>\n<p><span class=\"f-marker-p\">\u3010\u4f8b\uff12\u3011\u30c6\u30fc\u30d6\u30eb\u306e\u5168\u5217\u540d\u3001\u5168\u30c7\u30fc\u30bf\u3092\u8868\u793a<\/span><\/p>\n<p><span class=\"f-marker-y\">\u2605\u69cb\u6587<\/span><\/p>\n<blockquote>\n<p>SELECT\u3000<span>*<\/span><\/p>\n<p>FROM\u3000 \u00a0\u30c6\u30fc\u30d6\u30eb\u540d<span>;<\/span><\/p>\n<\/blockquote>\n<p>\u307e\u305f\u306f<\/p>\n<blockquote>\n<p>SELECT\u3000\u5217\u540d<span>1,<\/span>\u5217\u540d<span>2,<\/span>\u5217\u540d<span>3<\/span>\u30fb\u30fb\u30fb<\/p>\n<p>FROM\u3000 \u00a0\u30c6\u30fc\u30d6\u30eb\u540d<span>;<\/span><\/p>\n<\/blockquote>\n<p>\u5168\u9805\u76ee\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3001\u5168\u5217\u540d\u3092\u4e00\u3064\u305a\u3064\u6307\u5b9a\u3067\u3082\u300c*(\u30a2\u30b9\u30bf\u30ea\u30b9\u30af)\u300d\u3092\u6307\u5b9a\u3067\u3082\u540c\u3058\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u25cf\u5168\u5217\u540d\u3092\u4e00\u3064\u305a\u3064\u6307\u5b9a\u3057\u305f\u5834\u5408<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT\u793e\u54e1\u756a\u53f7,\u540d\u524d,\u90e8\u7f72\u540d,\u6027\u5225 FROM\u793e\u54e1\u8868;<\/pre>\n<p>\u25cf*(\u30a2\u30b9\u30bf\u30ea\u30b9\u30af)\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT * FROM \u793e\u54e1\u8868;<\/pre>\n<p><span class=\"f-marker-g\">\u51fa\u529b\u7d50\u679c<\/span><\/p>\n<pre class=\"prettyprint lang:default decode:true\">\u793e\u54e1\u756a\u53f7      \u540d\u524d     \u90e8\u7f72\u540d      \u6027\u5225\r\n----------------------------------------------------\r\n00001\t    \u540d\u524d1  \u3000 A\u90e8\u7f72\t\u7537\u6027\r\n00002\t    \u540d\u524d2 \u3000  A\u90e8\u7f72\t\u5973\u6027\r\n00003\t    \u540d\u524d3 \u3000  B\u90e8\u7f72\t\u7537\u6027\r\n00004\t    \u540d\u524d4 \u3000  A\u90e8\u7f72\t\u7537\u6027\r\n00005\t    \u540d\u524d5 \u3000  A\u90e8\u7f72\t\u5973\u6027\r\n00006\t    \u540d\u524d6 \u3000  B\u90e8\u7f72\t\u7537\u6027<\/pre>\n<p><span class=\"f-marker-p\">\u3010\u4f8b\uff13\u3011\u30c6\u30fc\u30d6\u30eb\u306e\u5168\u5217\u540d\u3001\u300cA\u90e8\u7f72\u300d\u3060\u3051\u306e\u30c7\u30fc\u30bf\u3092\u8868\u793a<\/span><\/p>\n<p><span class=\"f-marker-y\">\u2605\u69cb\u6587<\/span><\/p>\n<blockquote>\n<p>SELECT\u3000<span>*<\/span><\/p>\n<p>FROM\u3000\u30c6\u30fc\u30d6\u30eb\u540d<\/p>\n<p>WHERE\u5217\u540d \u6bd4\u8f03\u6f14\u7b97\u5b50 \u6761\u4ef6\u5024;<\/p>\n<\/blockquote>\n<p>\u307e\u305f\u306f<\/p>\n<blockquote>\n<p>SELECT\u3000\u5217\u540d<span>1,<\/span>\u5217\u540d<span>2,<\/span>\u5217\u540d<span>3<\/span>\u30fb\u30fb\u30fb<\/p>\n<p>FROM\u3000 \u00a0\u30c6\u30fc\u30d6\u30eb\u540d<\/p>\n<p>WHERE\u5217\u540d \u6bd4\u8f03\u6f14\u7b97\u5b50 \u6761\u4ef6\u5024;<\/p>\n<\/blockquote>\n<p>\u5217\u540d\u306e\u5024\u304c\u6587\u5b57\u306e\u5834\u5408\u306f\u3001\u6587\u5b57\u3092\u300c\u2019(\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3)\u300d\u3067\u56f2\u307f\u307e\u3059\u3002<\/p>\n<p>\u5217\u540d\u306e\u5024\u304c\u6570\u5b57\u306e\u5834\u5408\u306f\u3001\u6570\u5b57\u3092\u305d\u306e\u307e\u307e\u300c\u2019(\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3)\u300d\u3067\u56f2\u307f\u306f\u4e0d\u8981\u3067\u3059\u3002<\/p>\n<p>\u203b\u3053\u306e\u4f8b\u3067\u306f\u3001<span>&#8216;A<\/span>\u90e8\u7f72<span>&#8216;<\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3010\u53c2\u8003\u3011WHERE\u53e5\u3067\u4f7f\u7528\u3067\u304d\u308b\u6bd4\u8f03\u6f14\u7b97\u5b50<\/p>\n<table border=\"1\" style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center; background-color: #5fdec7;\">\u6bd4\u8f03\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center; background-color: #5fdec7;\">\u8aac\u660e<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">=<\/td>\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">\u7b49\u3057\u3044<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">&lt;<\/td>\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">\u5c0f\u3055\u3044<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">&gt;<\/td>\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">\u5927\u304d\u3044<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">&lt;=<\/td>\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">\u4ee5\u4e0b<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">&gt;=<\/td>\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">\u4ee5\u4e0a<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">&lt;&gt; \u307e\u305f\u306f !=<\/td>\n<td style=\"width: 50%; height: 24px; border-color: #000000; text-align: center;\">\u7b49\u3057\u304f\u306a\u3044<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"prettyprint lang:default decode:true\">SELECT * FROM\u793e\u54e1\u8868WHERE \u90e8\u7f72\u540d = 'A\u90e8\u7f72';<\/pre>\n<p><span class=\"f-marker-g\">\u51fa\u529b\u7d50\u679c<\/span><\/p>\n<pre class=\"prettyprint lang:default decode:true\">\u793e\u54e1\u756a\u53f7      \u540d\u524d     \u90e8\u7f72\u540d   \u3000   \u6027\u5225\r\n----------------------------------------------------\r\n00001\t    \u540d\u524d1  \u3000\u3000A\u90e8\u7f72\u3000\t\u3000\u7537\u6027\r\n00002\t    \u540d\u524d2  \u3000\u3000A\u90e8\u7f72\u3000\t\u3000\u5973\u6027\r\n00003\t    \u540d\u524d3  \u3000\u3000B\u90e8\u7f72\u3000\t\u3000\u7537\u6027\r\n00004\t    \u540d\u524d4  \u3000\u3000A\u90e8\u7f72\u3000\t\u3000\u7537\u6027\r\n00005\t    \u540d\u524d5  \u3000\u3000A\u90e8\u7f72\u3000\t\u3000\u5973\u6027\r\n00006\t    \u540d\u524d6\u3000  \u3000B\u90e8\u7f72\u3000\t\u3000\u7537\u6027<\/pre>\n<p><span class=\"f-marker-p\">\u3010\u4f8b4\u3011\u30c6\u30fc\u30d6\u30eb\u306e\u5168\u5217\u540d\u3001\u300cA\u90e8\u7f72\u300d\u3060\u3051\u306e\u30c7\u30fc\u30bf\u3067\u3001\u300c\u793e\u54e1\u756a\u53f7\u300d\u3067\u6607\u9806(\u591a\u3044\u9806)\u30fb\u964d\u9806(\u5c11\u306a\u3044\u9806)\u306b\u8868\u793a<\/span><\/p>\n<p><span class=\"f-marker-y\">\u2605\u69cb\u6587\uff08\u6607\u9806\uff09<\/span><\/p>\n<blockquote>\n<p>SELECT\u3000<span>*<\/span><\/p>\n<p>FROM\u3000\u30c6\u30fc\u30d6\u30eb\u540d<\/p>\n<p>WHERE\u5217\u540d \u6bd4\u8f03\u6f14\u7b97\u5b50 \u6761\u4ef6\u5024<\/p>\n<p>ORDER BY \u5217\u540d<span>;<\/span><\/p>\n<\/blockquote>\n<p>\u307e\u305f\u306f<\/p>\n<blockquote>\n<p>SELECT\u3000\u5217\u540d<span>1,<\/span>\u5217\u540d<span>2,<\/span>\u5217\u540d<span>3<\/span>\u30fb\u30fb\u30fb<\/p>\n<p>FROM\u3000 \u30c6\u30fc\u30d6\u30eb\u540d<\/p>\n<p>WHERE \u00a0\u5217\u540d \u6bd4\u8f03\u6f14\u7b97\u5b50 \u6761\u4ef6\u5024<\/p>\n<p>ORDER BY \u5217\u540d<span>;<\/span><\/p>\n<\/blockquote>\n<p><span class=\"f-marker-y\">\u2605\u69cb\u6587\uff08\u964d\u9806\uff09<\/span><\/p>\n<blockquote>\n<p>SELECT\u3000<span>*<\/span><\/p>\n<p>FROM\u3000 \u30c6\u30fc\u30d6\u30eb\u540d<\/p>\n<p>WHERE\u00a0 \u5217\u540d \u6bd4\u8f03\u6f14\u7b97\u5b50 \u6761\u4ef6\u5024<\/p>\n<p>ORDER BY \u5217\u540d <span>DESC;<\/span><\/p>\n<\/blockquote>\n<p>\u307e\u305f\u306f<\/p>\n<blockquote>\n<p>SELECT \u5217\u540d<span>1,<\/span>\u5217\u540d<span>2,<\/span>\u5217\u540d<span>3<\/span>\u30fb\u30fb\u30fb<\/p>\n<p>FROM\u3000 \u30c6\u30fc\u30d6\u30eb\u540d<\/p>\n<p>WHERE\u00a0 \u5217\u540d \u6bd4\u8f03\u6f14\u7b97\u5b50 \u6761\u4ef6\u5024<\/p>\n<p>ORDER BY \u5217\u540d <span>DESC;<\/span><\/p>\n<\/blockquote>\n<p>\u25cf\u5168\u5217\u540d\u3092\u4e00\u3064\u305a\u3064\u6307\u5b9a\u3057\u305f\u5834\u5408(\u6607\u9806)<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT\u793e\u54e1\u756a\u53f7,\u540d\u524d,\u90e8\u7f72\u540d,\u6027\u5225\r\nFROM\u793e\u54e1\u8868\r\nWHERE \u90e8\u7f72\u540d = 'A\u90e8\u7f72'\r\nORDER BY\u793e\u54e1\u756a\u53f7;<\/pre>\n<p>\u25cf*(\u30a2\u30b9\u30bf\u30ea\u30b9\u30af)\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408(\u6607\u9806)<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT\u3000*\r\nFROM\u3000\u793e\u54e1\u8868\r\nWHERE \u90e8\u7f72\u540d = 'A\u90e8\u7f72'\r\nORDER BY\u793e\u54e1\u756a\u53f7;<\/pre>\n<p><span class=\"f-marker-g\">\u51fa\u529b\u7d50\u679c<\/span><\/p>\n<pre class=\"prettyprint lang:default decode:true\">\u793e\u54e1\u756a\u53f7      \u540d\u524d     \u90e8\u7f72\u540d   \u3000   \u6027\u5225\r\n----------------------------------------------------\r\n00001\t    \u540d\u524d1 \u3000\u3000 A\u90e8\u7f72\t\u3000\u7537\u6027\r\n00002\t    \u540d\u524d2\u3000\u3000  A\u90e8\u7f72\t\u3000\u5973\u6027\r\n00004\t    \u540d\u524d4 \u3000\u3000 A\u90e8\u7f72\t\u3000\u7537\u6027\r\n00005\t    \u540d\u524d5 \u3000\u3000 A\u90e8\u7f72\t\u3000\u5973\u6027 <\/pre>\n<p>\u25cf\u5168\u5217\u540d\u3092\u4e00\u3064\u305a\u3064\u6307\u5b9a\u3057\u305f\u5834\u5408(\u964d\u9806)<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT\u793e\u54e1\u756a\u53f7,\u540d\u524d,\u90e8\u7f72\u540d,\u6027\u5225\r\nFROM\u793e\u54e1\u8868\r\nWHERE \u90e8\u7f72\u540d = 'A\u90e8\u7f72'\r\nORDER BY\u793e\u54e1\u756a\u53f7 DESC;<\/pre>\n<p>\u25cf*(\u30a2\u30b9\u30bf\u30ea\u30b9\u30af)\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408(\u964d\u9806)<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT\u3000*\r\nFROM\u793e\u54e1\u8868\r\nWHERE \u90e8\u7f72\u540d = 'A\u90e8\u7f72'\r\nORDER BY\u793e\u54e1\u756a\u53f7 DESC;<\/pre>\n<p><span class=\"f-marker-g\">\u51fa\u529b\u7d50\u679c<\/span><\/p>\n<pre class=\"prettyprint lang:default decode:true\">\u793e\u54e1\u756a\u53f7      \u540d\u524d     \u90e8\u7f72\u540d    \u3000  \u6027\u5225\r\n----------------------------------------------------\r\n00005\t    \u540d\u524d5 \u3000 \u3000A\u90e8\u7f72\t\u3000\u5973\u6027 \r\n00004\t    \u540d\u524d4 \u3000 \u3000A\u90e8\u7f72\t\u3000\u7537\u6027\r\n00002\t    \u540d\u524d2  \u3000\u3000A\u90e8\u7f72\t\u3000\u5973\u6027\r\n00001\t    \u540d\u524d1 \u3000 \u3000A\u90e8\u7f72\t\u3000\u7537\u6027<\/pre>\n<h2><span id=\"SQLDUAL\">\uff12\uff0e\u3010SQL\u3011\u5b9f\u969b\u306e\u5217\u540d\u306e\u5024\u306e\u52a0\u5de5\u5185\u5bb9\u3092\u78ba\u8a8d\uff5e\u899a\u3048\u3066\u304a\u304f\u3068\u4fbf\u5229\u306aDUAL\u8868\uff5e<\/span><\/h2>\n<p>\u3042\u308b\u7a0b\u5ea6\u3001<span>SELECT<\/span>\u6587\u3092\u4f5c\u6210\u306b\u6163\u308c\u3066\u304f\u308b\u3068\u3001\u5217\u540d\u306e\u5024\u3092\u52a0\u5de5\u3057\u3066\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u591a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5217\u540d\u306e\u5024\u306e\u52a0\u5de5\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u306e\u306b\u300c<span>DUAL<\/span>\u8868\u300d\u3092\u899a\u3048\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<p><span class=\"f-marker-p\">\u3010\u4f8b\u3011<span>SELECT<\/span>\u6587\u3067\u51fa\u529b\u3059\u308b\u3068\u304d\u306e\u65e5\u4ed8\u306e\u8868\u793a\u5f62\u5f0f\u3092\u300c<span>YYYY\/MM\/DD<\/span>\u300d\u306e\u8868\u793a\u306b\u3057\u305f\u3044<\/span><\/p>\n<p>\u25cf<span>ORACLE<\/span>\u306e\u5834\u5408\u3001\u65e5\u4ed8\u306e\u8868\u793a\u5f62\u5f0f\u306e\u78ba\u8a8d\u65b9\u6cd5<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT SYSDATE FROM DUAL;<\/pre>\n<p>\u25cf<span>DB2<\/span>\u306e\u5834\u5408\u3001\u65e5\u4ed8\u306e\u8868\u793a\u5f62\u5f0f\u306e\u78ba\u8a8d\u65b9\u6cd5<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT SYSDATE FROM SYSIBM.DUAL;<\/pre>\n<p><span class=\"f-marker-g\">\u51fa\u529b\u7d50\u679c<\/span><\/p>\n<pre class=\"prettyprint lang:default decode:true\">SYSDATE\r\n-------------------\r\n2018-12-09 00:00:00<\/pre>\n<p>\u5b9f\u969b\u305d\u306e\u307e\u307e\u4f7f\u7528\u3057\u3088\u3046\u3057\u305f\u5834\u5408\u3001\u8868\u793a\u3057\u305f\u3044\u5f62\u5f0f\u3068\u9055\u3046\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u5834\u5408\u3001SELECT\u6587\u306e\u65e5\u4ed8\u306e\u8868\u793a\u5f62\u5f0f\u3092\u52a0\u5de5\u3057\u307e\u3059\u3002<\/p>\n<p>\u25cf<span>ORACLE<\/span>\u306e\u5834\u5408<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT TO_CHAR(SYSDATE,\u2019YYYY\/MM\/DD\u2019) FROM DUAL;<\/pre>\n<p>\u25cf<span>DB2<\/span>\u306e\u5834\u5408<\/p>\n<pre class=\"prettyprint lang:default decode:true\">SELECT TO_CHAR(SYSDATE,\u2019YYYY\/MM\/DD\u2019) FROM SYSIBM.DUAL;<\/pre>\n<p><span class=\"f-marker-g\">\u51fa\u529b\u7d50\u679c<\/span><\/p>\n<pre class=\"prettyprint lang:default decode:true\">SYSDATE\r\n-------------------\r\n2018\/12\/10<\/pre>\n<p>\u203b\u3054\u4f7f\u7528\u306e<span>RDB<\/span>\u306b\u3088\u308a\u3001\u300c<span>DUAL<\/span>\u8868\u300d\u3001\u65e5\u4ed8\u306e\u8868\u793a\u306a\u3069\u3082\u7570\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u3054\u5229\u7528\u3059\u308b\u524d\u306b\u74b0\u5883\u306e\u3054\u78ba\u8a8d\u3092\u304a\u9858\u3044\u81f4\u3057\u307e\u3059\u3002<\/p>\n<h2><span id=\"i\">\uff13\uff0e\u3055\u3044\u3054\u306b<\/span><\/h2>\n<p>\u4ee5\u4e0a\u3001<span>SQL SELECT<\/span>\u306b\u3064\u3044\u3066\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<p>\u672c\u6765\u306a\u3089\u30ad\u30fc\u30ef\u30fc\u30c9\u3084\u6587\u5b57\u5217\u3084\u8a08\u7b97\u306a\u3069\u52a0\u5de5\u3057\u3066\u8868\u793a\u3059\u308b\u3068\u304d\u306b\u4f7f\u7528\u3059\u308b\u95a2\u6570\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3055\u307e\u3056\u307e\u306a\u52a0\u5de5\u65b9\u6cd5\u306f\u3001\u5fdc\u7528\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u307e\u305a\u306f\u3001\u57fa\u672c\u7684\u306a\u69cb\u6587\u3092\u3057\u3063\u304b\u308a\u7406\u89e3\u3057\u305f\u65b9\u304c\u3088\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u521d\u3081\u3066<span>SELECT<\/span>\u6587\u3092\u4f7f\u3046\u65b9\u306b\u306f\u3001\u62b5\u6297\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3093\u3067\u3001\u53c2\u8003\u306b\u306a\u308b\u3068\u3053\u308d\u304c\u3042\u308c\u3070\u5149\u6804\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL\u306e\u4e2d\u306eDML(Data Manipulation Language:\u30c7\u30fc\u30bf\u64cd\u4f5c\u8a00\u8a9e)\u306b\u306f\u3001SELECT(\u62bd\u51fa)\u30fbINSERT(\u633f\u5165)\u30fbUPDATE(\u66f4\u65b0)\u30fbDELETE(\u524a\u9664)\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u306e\u4e2d\u306eSELECT\u6587\u306b [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1181,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1179"}],"collection":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/comments?post=1179"}],"version-history":[{"count":9,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1179\/revisions"}],"predecessor-version":[{"id":5723,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1179\/revisions\/5723"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media\/1181"}],"wp:attachment":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media?parent=1179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/categories?post=1179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}