{"id":106433,"date":"2024-03-22T11:13:52","date_gmt":"2024-03-22T02:13:52","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"},"modified":"2024-04-04T08:20:33","modified_gmt":"2024-04-03T23:20:33","slug":"sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","title":{"rendered":"SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>SQL Server\u3067\u306f\u3001CAST\u95a2\u6570\u307e\u305f\u306fCONVERT\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u578b\u5909\u63db\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ol>\n<li>CAST\u95a2\u6570\u3092\u5229\u7528\u3057\u305f\u30c7\u30fc\u30bf\u578b\u306e\u5909\u63db<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-built_in\">CAST<\/span>(column_name <span class=\"hljs-keyword\">AS<\/span> new_data_type)\r\n<span class=\"hljs-keyword\">FROM<\/span> table_name;\r\n<\/code><\/pre>\n<p>\u6574\u6570\u578b\u5217\u3092\u6d6e\u52d5\u5c0f\u6570\u70b9\u5217\u306b\u5909\u63db\u3059\u308b\u5834\u5408<\/p>\n<pre class=\"post-pre\"><code><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-built_in\">CAST<\/span>(int_column <span class=\"hljs-keyword\">AS<\/span> <span class=\"hljs-type\">float<\/span>)\r\n<span class=\"hljs-keyword\">FROM<\/span> table_name;\r\n<\/code><\/pre>\n<ol>\n<li>CONVERT \u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u578b\u5909\u63db\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">CONVERT<\/span>(new_data_type, column_name)\r\n<span class=\"hljs-keyword\">FROM<\/span> table_name;\r\n<\/code><\/pre>\n<p>\u4f8b\u3048\u3070 \u65e5\u4ed8\u5217\u3092\u6587\u5b57\u5217\u5217\u306b\u5909\u63db\u3059\u308b\u306b\u306f\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">CONVERT<\/span>(<span class=\"hljs-type\">varchar<\/span>(<span class=\"hljs-number\">10<\/span>), date_column, <span class=\"hljs-number\">120<\/span>)\r\n<span class=\"hljs-keyword\">FROM<\/span> table_name;\r\n<\/code><\/pre>\n<p>\u4e0a\u306e\u30b3\u30fc\u30c9\u306e 3 \u756a\u76ee\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u300c120\u300d\u306f\u65e5\u4ed8\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u8868\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8abf\u6574\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u5909\u63db\u306e\u5931\u6557\u306b\u3088\u308a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u306e\u305f\u3081\u3001\u30c7\u30fc\u30bf\u578b\u5909\u63db\u3092\u5b9f\u884c\u3059\u308b\u524d\u306b\u3001\u30c7\u30fc\u30bf\u304c\u6b63\u3057\u304f\u5909\u63db\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002WHERE\u53e5\u306a\u3069\u306e\u65b9\u6cd5\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u307e\u305f\u306f\u691c\u8a3c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server\u3067\u306f\u3001CAST\u95a2\u6570\u307e\u305f\u306fCONVERT\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u578b\u5909\u63db\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002 CAST\u95a2\u6570\u3092\u5229\u7528\u3057\u305f\u30c7\u30fc\u30bf\u578b\u306e\u5909\u63db SELECT CAST(column_name AS new_data_type [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-106433","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/sql\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"SQL Server\u3067\u306f\u3001CAST\u95a2\u6570\u307e\u305f\u306fCONVERT\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u578b\u5909\u63db\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002 CAST\u95a2\u6570\u3092\u5229\u7528\u3057\u305f\u30c7\u30fc\u30bf\u578b\u306e\u5909\u63db SELECT CAST(column_name AS new_data_type [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/sql\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-22T02:13:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-03T23:20:33+00:00\" \/>\n<meta name=\"author\" content=\"\u7d50\u8863, \u6625\u82b1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u7d50\u8863, \u6625\u82b1\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"name\":\"SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2024-03-22T02:13:52+00:00\",\"dateModified\":\"2024-04-03T23:20:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/e52a686063ac76fd8cc6f539d41497ac\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/e52a686063ac76fd8cc6f539d41497ac\",\"name\":\"\u7d50\u8863, \u6625\u82b1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c74c6e2eb915a3c8e795b3934aa25a7333e0b38e7f1c7baf52785286ad51105e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c74c6e2eb915a3c8e795b3934aa25a7333e0b38e7f1c7baf52785286ad51105e?s=96&d=mm&r=g\",\"caption\":\"\u7d50\u8863, \u6625\u82b1\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/yuiharuka\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/sql\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5\/","og_locale":"ja_JP","og_type":"article","og_title":"SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5","og_description":"SQL Server\u3067\u306f\u3001CAST\u95a2\u6570\u307e\u305f\u306fCONVERT\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u578b\u5909\u63db\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002 CAST\u95a2\u6570\u3092\u5229\u7528\u3057\u305f\u30c7\u30fc\u30bf\u578b\u306e\u5909\u63db SELECT CAST(column_name AS new_data_type [&hellip;]","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/sql\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2024-03-22T02:13:52+00:00","article_modified_time":"2024-04-03T23:20:33+00:00","author":"\u7d50\u8863, \u6625\u82b1","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u7d50\u8863, \u6625\u82b1"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","name":"SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2024-03-22T02:13:52+00:00","dateModified":"2024-04-03T23:20:33+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/e52a686063ac76fd8cc6f539d41497ac"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL\u30b5\u30fc\u30d0\u30fc\u3067\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/e52a686063ac76fd8cc6f539d41497ac","name":"\u7d50\u8863, \u6625\u82b1","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c74c6e2eb915a3c8e795b3934aa25a7333e0b38e7f1c7baf52785286ad51105e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c74c6e2eb915a3c8e795b3934aa25a7333e0b38e7f1c7baf52785286ad51105e?s=96&d=mm&r=g","caption":"\u7d50\u8863, \u6625\u82b1"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/yuiharuka\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/sql%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%82%92%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/106433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=106433"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/106433\/revisions"}],"predecessor-version":[{"id":265843,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/106433\/revisions\/265843"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=106433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=106433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=106433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}