{"id":1349,"date":"2025-04-04T10:03:36","date_gmt":"2025-04-04T01:03:36","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/route\/1349\/"},"modified":"2025-07-04T10:08:35","modified_gmt":"2025-07-04T01:08:35","slug":"1349","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/1349\/","title":{"rendered":"\u3010SQL\u3011CHAR\u3068VARCHAR\u306e\u9055\u3044\u3068\u306f\uff1f\u300c\u7a7a\u767d\u304c\u57cb\u307e\u308b\u300d\u300c\u6587\u5b57\u304c\u5207\u308c\u308b\u300d\u3088\u304f\u3042\u308b\u3064\u307e\u305a\u304d\u3092\u5fb9\u5e95\u89e3\u8aac"},"content":{"rendered":"<div>\n<h2>CHAR\u3068VARCHAR\u3068\u306f\uff1f \u2014 \u57fa\u672c\u5b9a\u7fa9\u3068\u7528\u9014\u306e\u9055\u3044<\/h2>\n<p><strong>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u89e3\u6c7a\u3067\u304d\u308b\u3053\u3068\uff1a<\/strong><br \/>CHAR\u3068VARCHAR\u306e\u5b9a\u7fa9\u3084\u6027\u8cea\u306e\u9055\u3044\u304c\u3001\u521d\u5fc3\u8005\u306b\u3082\u5206\u304b\u308b\u8a00\u8449\u3068\u69cb\u9020\u3067\u7406\u89e3\u3067\u304d\u307e\u3059\u3002\u7528\u9014\u3054\u3068\u306e\u5411\u304d\u30fb\u4e0d\u5411\u304d\u3082\u5408\u308f\u305b\u3066\u5b66\u3079\u307e\u3059\u3002<\/p>\n<hr>\n<p>\u300cCHAR\u3068VARCHAR\u3063\u3066\u3001\u7d50\u5c40\u3069\u3046\u9055\u3046\u306e\uff1f\u300d<br \/>SQL\u3067\u30c6\u30fc\u30d6\u30eb\u8a2d\u8a08\u3092\u3057\u3066\u3044\u308b\u3068\u3001\u3053\u3093\u306a\u7591\u554f\u306b\u3076\u3064\u304b\u3063\u305f\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<\/p>\n<p>\u540c\u3058\u6587\u5b57\u5217\u3092\u4fdd\u5b58\u3057\u3066\u3044\u308b\u306f\u305a\u306a\u306e\u306b\u3001<\/p>\n<ul>\n<li>\n<p>\u300c\u4f59\u8a08\u306a\u7a7a\u767d\u304c\u3064\u3044\u3066\u3044\u305f\u300d<\/p>\n<\/li>\n<li>\n<p>\u300c\u671f\u5f85\u901a\u308a\u306b\u691c\u7d22\u30d2\u30c3\u30c8\u3057\u306a\u3044\u300d<\/p>\n<\/li>\n<li>\n<p>\u300c\u6587\u5b57\u6570\u304c\u8db3\u308a\u305a\u5207\u308c\u3066\u3057\u307e\u3063\u305f\u300d<\/p>\n<\/li>\n<\/ul>\n<p>\u2026\u3068\u3044\u3046\u30c8\u30e9\u30d6\u30eb\u304c\u8d77\u304d\u308b\u539f\u56e0\u306f\u3001\u3053\u306e\u30c7\u30fc\u30bf\u578b\u306e\u9055\u3044\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\u307e\u305aCHAR\u3068VARCHAR\u304c\u3069\u3046\u3044\u3046\u578b\u306a\u306e\u304b\u3001\u57fa\u672c\u304b\u3089\u6574\u7406\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h3>\u25c6 CHAR\u578b\u3068\u306f\uff08\u56fa\u5b9a\u9577\uff09<\/h3>\n<ul>\n<li>\n<p>\u5e38\u306b\u6307\u5b9a\u3057\u305f\u9577\u3055\u306e<strong>\u56fa\u5b9a\u9577<\/strong>\u6587\u5b57\u5217<\/p>\n<\/li>\n<li>\n<p>\u8db3\u308a\u306a\u3044\u5206\u306f<strong>\u81ea\u52d5\u7684\u306b\u7a7a\u767d\u3067\u57cb\u3081\u3089\u308c\u308b<\/strong><\/p>\n<\/li>\n<li>\n<p>\u4e3b\u306b\u300c\u30b3\u30fc\u30c9\u300d\u3084\u300c\u6c7a\u307e\u3063\u305f\u9577\u3055\u306e ID\u300d\u306a\u3069\u3001\u6587\u5b57\u5217\u9577\u304c<strong>\u4e00\u5b9a<\/strong>\u306e\u30c7\u30fc\u30bf\u306b\u4f7f\u308f\u308c\u308b<\/p>\n<\/li>\n<\/ul>\n<pre><code><span>CREATE TABLE <span>sample_char<\/span> <span>(\r\n  code CHAR(<span>5<\/span>)<\/span>\r\n)<\/span>;\r\n<span>INSERT INTO <span>sample_char<\/span> <span>(code)<\/span> <span>VALUES<\/span> <span>(<span>'AB'<\/span>)<\/span><\/span>;\r\n<\/code><\/pre>\n<p>\u2192 \u5b9f\u969b\u306b\u4fdd\u5b58\u3055\u308c\u308b\u5024\u306f &#8216;AB &#8216;\uff08\u7a7a\u767d\u304c3\u3064\u88dc\u5b8c\uff09<\/p>\n<hr>\n<h3>\u25c6 VARCHAR\u578b\u3068\u306f\uff08\u53ef\u5909\u9577\uff09<\/h3>\n<ul>\n<li>\n<p>\u5165\u529b\u3055\u308c\u305f\u6587\u5b57\u5217\u306e\u9577\u3055\u306b\u5fdc\u3058\u305f<strong>\u53ef\u5909\u9577<\/strong>\u6587\u5b57\u5217<\/p>\n<\/li>\n<li>\n<p>\u7121\u99c4\u306a\u7a7a\u767d\u306f\u4ed8\u304b\u306a\u3044<\/p>\n<\/li>\n<li>\n<p>\u4e3b\u306b\u300c\u540d\u524d\u300d\u300c\u30b3\u30e1\u30f3\u30c8\u300d\u306a\u3069\u3001<strong>\u9577\u3055\u304c\u307e\u3061\u307e\u3061\u306a\u30c7\u30fc\u30bf<\/strong>\u306b\u4f7f\u308f\u308c\u308b<\/p>\n<\/li>\n<\/ul>\n<pre><code><span>CREATE TABLE <span>sample_varchar<\/span> <span>(\r\n  name VARCHAR(<span>5<\/span>)<\/span>\r\n)<\/span>;\r\n<span>INSERT INTO <span>sample_varchar<\/span> <span>(name)<\/span> <span>VALUES<\/span> <span>(<span>'AB'<\/span>)<\/span><\/span>;\r\n<\/code><\/pre>\n<p>\u2192 \u5b9f\u969b\u306b\u4fdd\u5b58\u3055\u308c\u308b\u5024\u306f &#8216;AB&#8217;\uff08\u7a7a\u767d\u306a\u3057\uff09<\/p>\n<hr>\n<h3>\u25c6 \u307e\u3068\u3081\uff1a\u3069\u3061\u3089\u3092\u4f7f\u3046\uff1f<\/h3>\n<ul>\n<li>\n<p><strong>\u9577\u3055\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u306a\u3089 \u2192 CHAR<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u3070\u3089\u3064\u304d\u304c\u3042\u308b\u306a\u3089 \u2192 VARCHAR<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u5b9f\u969b\u306bINSERT\u30fbSELECT\u3057\u3066\u307f\u305f\u3068\u304d\u306e\u300c\u7a7a\u767d\u306e\u6271\u3044\u306e\u9055\u3044\u300d\u300c\u691c\u7d22\u6642\u306e\u6319\u52d5\u306e\u9055\u3044\u300d\u3092\u6bd4\u3079\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h2>\u5b9f\u4f8b\u3067\u6bd4\u8f03\uff01CHAR\u3068VARCHAR\u306e\u6319\u52d5\u306e\u9055\u3044<\/h2>\n<p><strong>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u89e3\u6c7a\u3067\u304d\u308b\u3053\u3068\uff1a<\/strong><br \/>\u5b9f\u969b\u306bINSERT\u30fbSELECT\u3057\u3066\u307f\u305f\u7d50\u679c\u304b\u3089\u3001\u30c7\u30fc\u30bf\u306e\u683c\u7d0d\u30fb\u8868\u793a\u4e0a\u306e\u9055\u3044\u304c\u8996\u899a\u7684\u306b\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<hr>\n<h3>\u25c6 \u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u3068\u30c7\u30fc\u30bf\u633f\u5165<\/h3>\n<pre><code>-- CHAR \u30c6\u30fc\u30d6\u30eb\r\n<span>CREATE TABLE <span>char_test<\/span> <span>(\r\n  val CHAR(<span>5<\/span>)<\/span>\r\n)<\/span>;\r\n\r\n-- VARCHAR \u30c6\u30fc\u30d6\u30eb\r\n<span>CREATE TABLE <span>varchar_test<\/span> <span>(\r\n  val VARCHAR(<span>5<\/span>)<\/span>\r\n)<\/span>;\r\n\r\n-- <span>2<\/span>\u6587\u5b57\u306e\u30c7\u30fc\u30bf\u3092\u633f\u5165\r\n<span>INSERT INTO <span>char_test<\/span> <span>(val)<\/span> <span>VALUES<\/span> <span>(<span>'AB'<\/span>)<\/span><\/span>;\r\n<span>INSERT INTO <span>varchar_test<\/span> <span>(val)<\/span> <span>VALUES<\/span> <span>(<span>'AB'<\/span>)<\/span><\/span>;\r\n<\/code><\/pre>\n<hr>\n<h3>\u25c6 SELECT \u3057\u3066\u307f\u308b<\/h3>\n<pre><code>SELECT val, LENGTH(val) FROM char_test;\r\n-- \u7d50\u679c: <span>'AB   '<\/span>, <span>5<\/span>\r\n\r\nSELECT val, LENGTH(val) FROM varchar_test;\r\n-- \u7d50\u679c: <span>'AB'<\/span>, <span>2<\/span>\r\n<\/code><\/pre>\n<p>\u2192 CHAR\u3067\u306f\u81ea\u52d5\u7684\u306b\u7a7a\u767d\u3067\u57cb\u3081\u3089\u308c\u30665\u6587\u5b57\u306b\u306a\u3063\u3066\u3044\u308b<br \/>\u2192 VARCHAR\u306f\u5165\u529b\u3055\u308c\u305f\u307e\u307e\u306e\u9577\u3055<\/p>\n<hr>\n<h3>\u25c6 WHERE \u53e5\u3067\u306e\u9055\u3044<\/h3>\n<pre><code>SELECT * FROM char_test WHERE val = <span>'AB'<\/span>;\r\n-- \u2192 \u30d2\u30c3\u30c8\u3057\u306a\u3044\uff08\u7a7a\u767d\u88dc\u5b8c\u3068\u4e00\u81f4\u3057\u306a\u3044\u305f\u3081\uff09\r\n\r\nSELECT * FROM char_test WHERE val = <span>'AB   '<\/span>;\r\n-- \u2192 \u30d2\u30c3\u30c8\u3059\u308b\r\n<\/code><\/pre>\n<p>\u3053\u308c\u306f\u3001<strong>CHAR\u578b\u306f\u7a7a\u767d\u8fbc\u307f\u3067\u4e00\u81f4\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081<\/strong>\u3067\u3059\u3002<\/p>\n<hr>\n<h2>\u30b9\u30c8\u30ec\u30fc\u30b8\u30fb\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30fb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u9762\u3067\u306e\u6bd4\u8f03<\/h2>\n<p><strong>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u89e3\u6c7a\u3067\u304d\u308b\u3053\u3068\uff1a<\/strong><br \/>\u30b9\u30c8\u30ec\u30fc\u30b8\u30b5\u30a4\u30ba\u3084\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u4f5c\u6210\u306e\u5f71\u97ff\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u3069\u3046\u9055\u3044\u304c\u51fa\u308b\u304b\u7406\u89e3\u3067\u304d\u307e\u3059\u3002<\/p>\n<hr>\n<h3>\u25c6 \u30b9\u30c8\u30ec\u30fc\u30b8\u4f7f\u7528\u91cf<\/h3>\n<ul>\n<li>\n<p><strong>CHAR:<\/strong> \u5e38\u306b\u56fa\u5b9a\u9577\u30025\u6587\u5b57\u306a\u3089\u5e38\u306b5\u30d0\u30a4\u30c8\uff08+\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\uff09<\/p>\n<\/li>\n<li>\n<p><strong>VARCHAR:<\/strong> \u5165\u529b\u306b\u5fdc\u3058\u305f\u9577\u3055 + \u9577\u3055\u60c5\u5831\u3092\u4fdd\u6301\u3059\u308b1\u301c2\u30d0\u30a4\u30c8<\/p>\n<\/li>\n<\/ul>\n<p>\uff01 \u5c11\u91cf\u30c7\u30fc\u30bf\u306a\u3089 CHAR \u306e\u7121\u99c4\u306f\u5c0f\u3055\u3044\u304c\u3001\u5927\u91cf\u30fb\u9577\u6587\u3060\u3068 VARCHAR \u304c\u5727\u5012\u7684\u306b\u52b9\u7387\u7684\u3002<\/p>\n<hr>\n<h3>\u25c6 \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u9762\uff08\u8aad\u307f\u53d6\u308a\u901f\u5ea6\uff09<\/h3>\n<ul>\n<li>\n<p>CHAR\u306f\u56fa\u5b9a\u9577\u306a\u306e\u3067<strong>\u6bd4\u8f03\u304c\u9ad8\u901f<\/strong><\/p>\n<\/li>\n<li>\n<p>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u30b5\u30a4\u30ba\u304c\u4e00\u5b9a\u306e\u305f\u3081<strong>\u5185\u90e8\u51e6\u7406\u304c\u30b7\u30f3\u30d7\u30eb<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u4e00\u65b9\u3067\u3001\u53ef\u5909\u9577\u306eVARCHAR\u306f\u51e6\u7406\u30b3\u30b9\u30c8\u304c\u82e5\u5e72\u304b\u304b\u308a\u307e\u3059\u3002<\/p>\n<hr>\n<h3>\u25c6 UPDATE \u306e\u5f71\u97ff\u3068\u65ad\u7247\u5316<\/h3>\n<ul>\n<li>\n<p>VARCHAR\u3067\u306f\u3001\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u3068<strong>\u30da\u30fc\u30b8\u5206\u5272\u3084\u30d5\u30e9\u30b0\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3<\/strong>\u304c\u8d77\u304d\u3084\u3059\u3044<\/p>\n<\/li>\n<li>\n<p>CHAR\u306f\u9577\u3055\u304c\u5909\u308f\u3089\u306a\u3044\u305f\u3081\u3001<strong>\u66f4\u65b0\u6642\u306b\u30c7\u30fc\u30bf\u914d\u7f6e\u304c\u5b89\u5b9a<\/strong><\/p>\n<\/li>\n<\/ul>\n<hr>\n<h2>\u5b9f\u52d9\u3067\u3069\u3046\u4f7f\u3044\u5206\u3051\u308b\uff1f\u9078\u5b9a\u306e\u305f\u3081\u306e\u5224\u65ad\u57fa\u6e96<\/h2>\n<p><strong>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u89e3\u6c7a\u3067\u304d\u308b\u3053\u3068\uff1a<\/strong><br \/>\u300c\u3069\u3063\u3061\u3092\u9078\u3079\u3070\u3088\u3044\u304b\u300d\u304c\u5206\u304b\u3089\u306a\u3044\u8aad\u8005\u306b\u3001\u5224\u65ad\u8ef8\u3092\u5177\u4f53\u7684\u306b\u63d0\u793a\u3057\u307e\u3059\u3002<\/p>\n<hr>\n<h3>\u5224\u65ad\u30d5\u30ed\u30fc\uff08if-then \u578b\uff09<\/h3>\n<ul>\n<li>\n<p><strong>IF<\/strong> \u9577\u3055\u304c\u5e38\u306b\u540c\u3058 \u2192 <strong>THEN CHAR<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>IF<\/strong> \u9577\u3055\u306b\u3070\u3089\u3064\u304d \u2192 <strong>THEN VARCHAR<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>IF<\/strong> \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u91cd\u8996\u3067\u8aad\u307f\u53d6\u308a\u6700\u901f\u3092\u512a\u5148 \u2192 <strong>THEN CHAR<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>IF<\/strong> \u30c7\u30a3\u30b9\u30af\u4f7f\u7528\u91cf\u3084\u67d4\u8edf\u6027\u91cd\u8996 \u2192 <strong>THEN VARCHAR<\/strong><\/p>\n<\/li>\n<\/ul>\n<hr>\n<h3>\u30b7\u30fc\u30f3\u5225\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h3>\n<ul>\n<li>\n<p>\u56fd\u30b3\u30fc\u30c9\uff08\u4f8b\uff1aJP, US\uff09\u2192 CHAR(2)<\/p>\n<\/li>\n<li>\n<p>\u90f5\u4fbf\u756a\u53f7 \u2192 CHAR(7)<\/p>\n<\/li>\n<li>\n<p>\u6c0f\u540d\u30fb\u30cb\u30c3\u30af\u30cd\u30fc\u30e0 \u2192 VARCHAR(50)<\/p>\n<\/li>\n<li>\n<p>\u30b3\u30e1\u30f3\u30c8\u30fb\u5099\u8003\u6b04 \u2192 VARCHAR(255) \u4ee5\u4e0a<\/p>\n<\/li>\n<\/ul>\n<hr>\n<h2>\u3088\u304f\u3042\u308b\u8aa4\u89e3\u3068\u3064\u307e\u305a\u304d\u306e\u89e3\u6d88 Q&amp;A<\/h2>\n<p><strong>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u89e3\u6c7a\u3067\u304d\u308b\u3053\u3068\uff1a<\/strong><br \/>\u5178\u578b\u7684\u306a\u30c8\u30e9\u30d6\u30eb\u30fb\u8aa4\u89e3\u3092Q&amp;A\u5f62\u5f0f\u3067\u660e\u5feb\u306b\u89e3\u6c7a\u3057\u307e\u3059\u3002<\/p>\n<hr>\n<h3>Q1. CHAR\u578b\u3092\u4f7f\u3063\u305f\u3089LIKE\u691c\u7d22\u3067\u30d2\u30c3\u30c8\u3057\u306a\u3044\uff1f<\/h3>\n<p>A. \u7a7a\u767d\u304c\u672b\u5c3e\u306b\u81ea\u52d5\u8ffd\u52a0\u3055\u308c\u308b\u305f\u3081\u3001LIKE &#8216;abc%&#8217;\u306e\u3088\u3046\u306a\u66d6\u6627\u691c\u7d22\u3068<strong>\u4e0d\u4e00\u81f4<\/strong>\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002TRIM()\u3084RTRIM()\u3092\u4f7f\u3063\u3066\u7a7a\u767d\u3092\u9664\u53bb\u3059\u308b\u3068\u89e3\u6c7a\u3057\u307e\u3059\u3002<\/p>\n<hr>\n<h3>Q2. VARCHAR\u3067\u5b9a\u7fa9\u3057\u305f\u306e\u306b\u6587\u5b57\u304c\u5207\u308c\u308b\uff1f<\/h3>\n<p>A. \u5b9a\u7fa9\u3057\u305f\u6700\u5927\u9577\uff08\u4f8b\uff1aVARCHAR(5)\uff09\u3092<strong>\u8d85\u3048\u305f\u6587\u5b57\u5217\u3092INSERT\u3059\u308b\u3068\u81ea\u52d5\u3067\u5207\u308a\u8a70\u3081\u3089\u308c\u308b<\/strong>\u3001\u3042\u308b\u3044\u306f\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\u5165\u529b\u5024\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h3>Q3. CHAR(1)\u3068VARCHAR(1)\u306f\u3069\u3046\u9055\u3046\u306e\uff1f<\/h3>\n<p>A. \u898b\u305f\u76ee\u306e\u9055\u3044\u306f\u5c11\u306a\u3044\u3067\u3059\u304c\u3001\u56fa\u5b9a\u9577\u306eCHAR(1)\u306f<strong>\u8aad\u307f\u53d6\u308a\u9ad8\u901f\uff06\u7701\u30e1\u30e2\u30ea<\/strong>\u3002\u305f\u3060\u3057\u5b9f\u52d9\u4e0a\u306e\u9055\u3044\u306f\u307b\u307c\u8aa4\u5dee\u306a\u306e\u3067\u3001\u30b3\u30fc\u30c9\u4e0a\u306e\u4e00\u8cab\u6027\u3067\u9078\u3093\u3067\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<hr>\n<h2>\u307e\u3068\u3081\u3068\u304a\u3059\u3059\u3081\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h2>\n<p><strong>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u89e3\u6c7a\u3067\u304d\u308b\u3053\u3068\uff1a<\/strong><br \/>\u7406\u89e3\u3057\u305f\u5185\u5bb9\u3092\u4e00\u5ea6\u307e\u3068\u3081\u3001\u5b9f\u52d9\u5224\u65ad\u3067\u306e\u6d3b\u7528\u306b\u7e4b\u3052\u307e\u3059\u3002<\/p>\n<hr>\n<h3>&#x2714;\ufe0e \u8981\u70b9\u307e\u3068\u3081<\/h3>\n<ul>\n<li>\n<p>CHAR\uff1a<strong>\u56fa\u5b9a\u9577\u3001\u7a7a\u767d\u88dc\u5b8c\u3001\u9ad8\u901f\u8aad\u307f\u53d6\u308a<\/strong><\/p>\n<\/li>\n<li>\n<p>VARCHAR\uff1a<strong>\u53ef\u5909\u9577\u3001\u67d4\u8edf\u306a\u9577\u3055\u3001\u7701\u30e1\u30e2\u30ea<\/strong><\/p>\n<\/li>\n<\/ul>\n<hr>\n<h3>&#x2714;\ufe0e \u578b\u9078\u629e\u30d5\u30ed\u30fc<\/h3>\n<pre><code>1. \u30c7\u30fc\u30bf\u306e\u9577\u3055\u306f\u56fa\u5b9a\u304b\uff1f \u2192 Yes \u2192 CHAR \/ No \u2192 VARCHAR\r\n2. \u66f4\u65b0\u983b\u5ea6\u306f\uff1f \u2192 \u4f4e\u3051\u308c\u3070 CHAR\u3001\u9ad8\u3051\u308c\u3070 VARCHAR\r\n3. \u691c\u7d22\u30fb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u91cd\u8996\uff1f \u2192 CHAR\r\n4. \u30b9\u30c8\u30ec\u30fc\u30b8\u52b9\u7387\u91cd\u8996\uff1f \u2192 VARCHAR\r\n<\/code><\/pre>\n<hr>\n<h3>&#x2714;\ufe0e \u3053\u308c\u304b\u3089\u306e\u8a2d\u8a08\u306b\u6d3b\u304b\u3059\u305f\u3081\u306b<\/h3>\n<p>\u300c\u306a\u3093\u3068\u306a\u304f\u300d\u3067\u306f\u306a\u304f\u3001\u300c\u3053\u3046\u3060\u304b\u3089CHAR\u300d\u300c\u3053\u306e\u7406\u7531\u3067VARCHAR\u300d\u3068\u3044\u3046\u5224\u65ad\u3092\u4e0b\u305b\u308b\u3088\u3046\u306b\u306a\u308c\u3070\u3001SQL\u8a2d\u8a08\u306f\u683c\u6bb5\u306b\u5b89\u5b9a\u3057\u307e\u3059\u3002<br \/>\u3042\u306a\u305f\u306e\u9078\u629e\u304c\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u3082\u4fdd\u5b88\u6027\u306b\u3082\u7e4b\u304c\u308a\u307e\u3059\u3002<\/p>\n<hr>\n<h2> \u304a\u308f\u308a\u306b<\/h2>\n<p>CHAR\u3068VARCHAR\u306e\u9055\u3044\u306f\u3001\u6700\u521d\u306f\u3084\u3084\u3053\u3057\u304f\u611f\u3058\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\u3067\u3082\u3001\u5b9f\u4f8b\u3067\u4f53\u9a13\u3057\u306a\u304c\u3089\u5b66\u3076\u3053\u3068\u3067\u3001\u78ba\u5b9f\u306b\u4f7f\u3044\u3053\u306a\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u300c\u7a7a\u767d\u304c\u5165\u3063\u3066\u3057\u307e\u3063\u305f\u300d\u300c\u691c\u7d22\u306b\u5f15\u3063\u304b\u304b\u3089\u306a\u3044\u300d\u2026\u305d\u3093\u306a\u3064\u307e\u305a\u304d\u306b\u3001\u3082\u3046\u60a9\u307e\u306a\u304f\u3066\u5927\u4e08\u592b\u3067\u3059\u3002<\/p>\n<p><strong>\u3042\u306a\u305f\u306eSQL\u8a2d\u8a08\u304c\u3001\u4eca\u3088\u308a\u4e00\u6bb5\u30b9\u30de\u30fc\u30c8\u306b\u306a\u308a\u307e\u3059\u3088\u3046\u306b\u3002<\/strong><\/p>\n<h3>\u3010\u5916\u90e8\u30ea\u30f3\u30af\u3011<\/h3>\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/char.html\" target=\"_blank\" rel=\"noopener\">MySQL\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\uff1aCHAR\u578b<\/a><\/p>\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/char.html\" target=\"_blank\" rel=\"noopener\">MySQL\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\uff1aVARCHAR\u578b<\/a><\/p>\n<p><a href=\"https:\/\/www.postgresql.org\/docs\/current\/datatype-character.html\" target=\"_blank\" rel=\"noopener\">PostgreSQL\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\uff1a\u6587\u5b57\u5217\u30c7\u30fc\u30bf\u578b<\/a><\/p>\n<h3>\u3010\u5185\u90e8\u30ea\u30f3\u30af\u3011<\/h3>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/1323\/\">SQL CASE WHEN \u5165\u9580\u304b\u3089\u5b9f\u8df5\u307e\u3067\uff01\u521d\u5fc3\u8005\u3082\u308f\u304b\u308b\u6761\u4ef6\u5206\u5c90\u30af\u30a8\u30ea\u306e\u66f8\u304d\u65b9<\/a><\/p>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/1283\/\">SQL Syntax Error\u306e\u539f\u56e0\u3068\u5bfe\u51e6\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\uff5c\u4eca\u3059\u3050\u8a66\u305b\u308b\u30a8\u30e9\u30fc\u89e3\u6c7a\u6cd5<\/a><\/p>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/1241\/\">SQL UNION\u306e\u4f7f\u3044\u65b9\u3092\u3084\u3055\u3057\u304f\u89e3\u8aac\uff5c\u9055\u3044\u30fb\u6ce8\u610f\u70b9\u30fb\u6d3b\u7528\u4f8b\u307e\u3068\u3081<\/a><\/p>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/1119\/\">SQL JOIN\u306e\u57fa\u672c\u304b\u3089\u5b9f\u8df5\u307e\u3067\uff5cINNER\u30fbLEFT\u30fbRIGHT\u30fbOUTER JOIN\u306e\u9055\u3044\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/1233\/\">\u521d\u5fc3\u8005\u5411\u3051SQL\u8b1b\u5ea7\uff5cSELECT\u6587\u306e\u66f8\u304d\u65b9\u3068\u5b9f\u884c\u9806\u3092\u5b8c\u5168\u89e3\u8aac<\/a><\/p>\n<\/div>\n","protected":false},"featured_media":1350,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/1349"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/1350"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=1349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}