{"id":16372,"date":"2024-11-15T02:04:07","date_gmt":"2024-11-14T22:34:07","guid":{"rendered":"https:\/\/www.itpiran.net\/blog\/?p=16372"},"modified":"2024-11-15T02:04:07","modified_gmt":"2024-11-14T22:34:07","slug":"how-to-use-functions-in-sqlusing-date-and-time-functions","status":"publish","type":"post","link":"https:\/\/www.itpiran.net\/blog\/ja\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/","title":{"rendered":"SQL\u95a2\u6570\u306e\u4f7f\u3044\u65b9"},"content":{"rendered":"<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87\">\u5c0e\u5165<\/h2>\n<p>\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u69cb\u9020\u5316\u7167\u4f1a\u8a00\u8a9e\uff08SQL\uff09\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3001\u7ba1\u7406\u3001\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002SQL\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u305d\u306e\u307e\u307e\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>SQL\u3067\u306f\u3001\u95a2\u6570\u3092\u4f7f\u3063\u3066\u8a08\u7b97\u3084\u30c7\u30fc\u30bf\u306e\u64cd\u4f5c\u3092\u884c\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u95a2\u6570\u3092\u4f7f\u3063\u3066\u5546\u54c1\u4fa1\u683c\u3092\u6700\u3082\u8fd1\u3044\u30c9\u30eb\u306b\u4e38\u3081\u3066\u53d6\u5f97\u3057\u305f\u308a\u3001\u5546\u54c1\u306e\u5e73\u5747\u8cfc\u5165\u56de\u6570\u3092\u8a08\u7b97\u3057\u305f\u308a\u3001\u8cfc\u5165\u3057\u305f\u5546\u54c1\u306e\u4fdd\u8a3c\u671f\u9650\u307e\u3067\u306e\u65e5\u6570\u3092\u8abf\u3079\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u3055\u307e\u3056\u307e\u306a SQL \u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u6570\u5b66\u7684\u306a\u8a08\u7b97\u3092\u5b9f\u884c\u3057\u3001\u6587\u5b57\u5217\u3068\u65e5\u4ed8\u3092\u64cd\u4f5c\u3057\u3001\u96c6\u8a08\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u8981\u7d04\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002.<\/p>\n<h5 id=\"%d9%be%db%8c%d8%b4%d9%86%db%8c%d8%a7%d8%b2%d9%87%d8%a7\">\u524d\u63d0\u6761\u4ef6<\/h5>\n<p>\u3053\u306e\u30ac\u30a4\u30c9\u306b\u5f93\u3046\u306b\u306f\u3001SQL\u30d9\u30fc\u30b9\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\uff08RDBMS\uff09\u304c\u52d5\u4f5c\u3059\u308b\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u30ac\u30a4\u30c9\u306e\u624b\u9806\u3068\u4f8b\u306f\u3001\u4ee5\u4e0b\u306e\u74b0\u5883\u3067\u691c\u8a3c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>Ubuntu 20.04 \u306e\u521d\u671f\u30b5\u30fc\u30d0\u30fc \u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 \u30ac\u30a4\u30c9\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u7ba1\u7406\u8005\u6a29\u9650\u3092\u6301\u3064\u975e root \u30e6\u30fc\u30b6\u30fc\u3068 UFW \u3067\u69cb\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066 Ubuntu 20.04 \u3092\u5b9f\u884c\u3059\u308b\u30b5\u30fc\u30d0\u30fc\u3002.<\/li>\n<li>MySQL\u306f\u3001\u300cUbuntu 20.04\u306bMySQL\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u300d\u30ac\u30a4\u30c9\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3068\u304a\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4fdd\u8b77\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30ac\u30a4\u30c9\u3067\u306f\u3001\u624b\u98063\u3067\u8aac\u660e\u3057\u305f\u624b\u9806\u3067\u4f5c\u6210\u3055\u308c\u305f\u975eroot\u306eMySQL\u30e6\u30fc\u30b6\u30fc\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3057\u3066\u3044\u307e\u3059\u3002.<\/li>\n<li>\u300cSQL \u3067\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u884c\u3092\u9078\u629e\u3059\u308b\u65b9\u6cd5\u300d\u30ac\u30a4\u30c9\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u9078\u629e\u3059\u308b\u305f\u3081\u306e SELECT \u30af\u30a8\u30ea\u306e\u5b9f\u884c\u306b\u95a2\u3059\u308b\u57fa\u672c\u7684\u306a\u7d39\u4ecb\u3002.<\/li>\n<\/ul>\n<p><span style=\"color: #ff0000;\">\u6ce8: \u591a\u304f\u306eRDBMS\u306f\u72ec\u81ea\u306eSQL\u5b9f\u88c5\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u8aac\u660e\u3059\u308b\u30b3\u30de\u30f3\u30c9\u306f\u307b\u3068\u3093\u3069\u306eRDBMS\u3067\u52d5\u4f5c\u3057\u307e\u3059\u304c\u3001\u6a19\u6e96SQL\u69cb\u6587\u3067\u306f\u9650\u3089\u308c\u305f\u6570\u306e\u95a2\u6570\u3057\u304b\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u307e\u305f\u3001\u6a19\u6e96\u69cb\u6587\u306e\u30b5\u30dd\u30fc\u30c8\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a8\u30f3\u30b8\u30f3\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3002MySQL\u4ee5\u5916\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u30c6\u30b9\u30c8\u3057\u305f\u5834\u5408\u3001\u6b63\u78ba\u306a\u69cb\u6587\u3084\u51fa\u529b\u304c\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002.<\/span><\/p>\n<p>\u307e\u305f\u3001\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u304c\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u542b\u3080\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3082\u5fc5\u8981\u3067\u3059\u3002MySQL\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u63a5\u7d9a\u3068\u3001\u3053\u306e\u30ac\u30a4\u30c9\u306e\u4f8b\u3067\u4f7f\u7528\u3059\u308b\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210\u65b9\u6cd5\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u300cMySQL\u3078\u306e\u63a5\u7d9a\u3068\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u300d\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002.<\/p>\n<h3 id=\"%d8%a7%d8%aa%d8%b5%d8%a7%d9%84-%d8%a8%d9%87-mysql-%d9%88-%d8%b1%d8%a7%d9%87%d8%a7%d9%86%d8%af%d8%a7%d8%b2%db%8c-%db%8c%da%a9-%d9%be%d8%a7%db%8c%da%af%d8%a7%d9%87-%d8%af%d8%a7%d8%af%d9%87\">MySQL\u3078\u306e\u63a5\u7d9a\u3068\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a<\/h3>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u306e\u30ac\u30a4\u30c9\u306e\u4f8b\u306b\u5f93\u3046\u305f\u3081\u306b\u3001MySQL \u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3066\u30b5\u30f3\u30d7\u30eb \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002.<\/p>\n<p>SQL \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9 \u30b7\u30b9\u30c6\u30e0\u304c\u30ea\u30e2\u30fc\u30c8 \u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u3001SSH \u7d4c\u7531\u3067\u30b5\u30fc\u30d0\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>ssh sammy@your_server_ip<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306bMySQL\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u3092\u958b\u304d\u307e\u3059\u3002 <code>\u30b5\u30df\u30fc<\/code> MySQL \u30e6\u30fc\u30b6\u30fc\u540d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>mysql -u sammy -p<\/code><\/pre>\n<\/div>\n<p>bookstore \u3068\u3044\u3046\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>CREATE DATABASE bookstore;<\/code><\/pre>\n<\/div>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u6b63\u5e38\u306b\u4f5c\u6210\u3055\u308c\u305f\u5834\u5408\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\nQuery OK, 1 row affected (0.01 sec)<\/code><\/pre>\n<\/div>\n<p>bookstore \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9078\u629e\u3059\u308b\u306b\u306f\u3001USE \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>USE bookstore;<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\nDatabase changed<\/code><\/pre>\n<\/div>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9078\u629e\u3057\u305f\u3089\u3001\u305d\u306e\u4e2d\u306b\u30b5\u30f3\u30d7\u30eb\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30ac\u30a4\u30c9\u3067\u306f\u3001\u69d8\u3005\u306a\u8457\u8005\u306e\u69d8\u3005\u306a\u66f8\u7c4d\u3092\u8ca9\u58f2\u3059\u308b\u67b6\u7a7a\u306e\u56f3\u66f8\u9928\u3092\u4f8b\u306b\u6319\u3052\u307e\u3059\u3002.<\/p>\n<p>\u5728\u5eab\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u3001\u66f8\u5e97\u3067\u5165\u624b\u53ef\u80fd\u306a\u66f8\u7c4d\u306b\u95a2\u3059\u308b\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u4ee5\u4e0b\u306e\u5217\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>book_id: \u3053\u306e\u5217\u306b\u306f\u3001int\u30c7\u30fc\u30bf\u578b\u3067\u8868\u3055\u308c\u308b\u5404\u66f8\u7c4d\u306eID\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u5217\u306f\u30c6\u30fc\u30d6\u30eb\u306e\u4e3b\u30ad\u30fc\u3068\u306a\u308a\u3001\u5404\u5024\u306f\u5bfe\u5fdc\u3059\u308b\u884c\u306e\u4e00\u610f\u306e\u8b58\u5225\u5b50\u3068\u306a\u308a\u307e\u3059\u3002.<\/li>\n<li>\u8457\u8005: \u3053\u306e\u5217\u306b\u306f\u3001\u6700\u5927 50 \u6587\u5b57\u306e varchar \u30c7\u30fc\u30bf\u578b\u3092\u4f7f\u7528\u3057\u3066\u8868\u3055\u308c\u305f\u672c\u306e\u8457\u8005\u306e\u540d\u524d\u304c\u542b\u307e\u308c\u307e\u3059\u3002.<\/li>\n<li>\u30bf\u30a4\u30c8\u30eb: \u3053\u306e\u5217\u306b\u306f\u3001\u8cfc\u5165\u3057\u305f\u66f8\u7c4d\u306e\u30bf\u30a4\u30c8\u30eb\u304c\u542b\u307e\u308c\u307e\u3059\u3002\u30bf\u30a4\u30c8\u30eb\u306f\u3001\u6700\u5927 200 \u6587\u5b57\u306e varchar \u30c7\u30fc\u30bf\u578b\u3067\u8868\u3055\u308c\u307e\u3059\u3002.<\/li>\n<li>introduction_date: \u3053\u306e\u5217\u306f\u65e5\u4ed8\u30c7\u30fc\u30bf\u578b\u3092\u4f7f\u7528\u3057\u3066\u3001\u66f8\u5e97\u3067\u5404\u66f8\u7c4d\u304c\u7d39\u4ecb\u3055\u308c\u305f\u65e5\u4ed8\u3092\u8a18\u9332\u3057\u307e\u3059\u3002.<\/li>\n<li>\u5728\u5eab: \u3053\u306e\u5217\u306b\u306f\u3001\u66f8\u5e97\u306e\u5728\u5eab\u306b\u3042\u308b\u66f8\u7c4d\u306e\u6570\u304c\u6574\u6570\u30c7\u30fc\u30bf\u578b\u3067\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002.<\/li>\n<li>\u4fa1\u683c: \u3053\u306e\u5217\u306b\u306f\u3001\u5c0f\u6570\u70b9\u306e\u524d\u306b\u6700\u5927 5 \u3064\u306e\u5024\u3001\u5c0f\u6570\u70b9\u306e\u5f8c\u306b\u6700\u5927 2 \u3064\u306e\u5024\u3092\u6301\u3064\u5c0f\u6570\u30c7\u30fc\u30bf\u578b\u3092\u4f7f\u7528\u3057\u3066\u3001\u66f8\u7c4d\u306e\u5c0f\u58f2\u4fa1\u683c\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002.<\/li>\n<\/ul>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30b5\u30f3\u30d7\u30eb \u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>CREATE TABLE inventory (\r\nbook_id int,\r\nauthor varchar(50),\r\ntitle varchar(200),\r\nintroduction_date date,\r\nstock int,\r\nprice decimal(5, 2),\r\nPRIMARY KEY (book_id)\r\n);<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u51fa\u529b\u304c\u5370\u5237\u3055\u308c\u305f\u5834\u5408\u3001\u30c6\u30fc\u30d6\u30eb\u306f\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\nQuery OK, 0 rows affected (0.00 sec)<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306b\u3001\u6b21\u306e INSERT INTO \u64cd\u4f5c\u3092\u5b9f\u884c\u3057\u3066\u3001purchases \u30c6\u30fc\u30d6\u30eb\u306b\u30b5\u30f3\u30d7\u30eb \u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>INSERT INTO inventory\r\nVALUES\r\n(1, 'Oscar Wilde', 'The Picture of Dorian Gray', '2022-10-01', 4, 20.83),\r\n(2, 'Jane Austen', 'Pride and Prejudice', '2022-10-04', 12, 42.13),\r\n(3, 'Herbert George Wells', 'The Time Machine', '2022-09-23', 7, 21.99),\r\n(4, 'Mary Shelley', 'Frankenstein', '2022-07-23', 9, 17.43),\r\n(5, 'Mark Twain', 'The Adventures of Huckleberry Finn', '2022-10-01', 14, 23.15);<\/code><\/pre>\n<\/div>\n<p>INSERT INTO \u64cd\u4f5c\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u5024\u3092\u6301\u30645\u518a\u306e\u672c\u3092 inventory \u30c6\u30fc\u30d6\u30eb\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\u6b21\u306e\u51fa\u529b\u306f\u30015\u884c\u3059\u3079\u3066\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\nQuery OK, 5 rows affected (0.00 sec)\r\nRecords: 5 Duplicates: 0 Warnings: 0\r\n<\/code><\/pre>\n<\/div>\n<p>\u3053\u308c\u3067\u3001\u30ac\u30a4\u30c9\u306e\u6b8b\u308a\u306e\u90e8\u5206\u306b\u5f93\u3063\u3066\u3001SQL \u306e\u95a2\u6570\u3092\u4f7f\u3044\u59cb\u3081\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002.<\/p>\n<h2 id=\"%d8%af%d8%b1%da%a9-%d8%aa%d9%88%d8%a7%d8%a8%d8%b9-sql\">SQL\u95a2\u6570\u306e\u7406\u89e3<\/h2>\n<p>\u95a2\u6570\u3068\u306f\u30011\u3064\u4ee5\u4e0a\u306e\u5024\u3092\u53d7\u3051\u53d6\u308a\u3001\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u8a08\u7b97\u307e\u305f\u306f\u5909\u63db\u3092\u5b9f\u884c\u3057\u3001\u7d50\u679c\u3068\u3057\u3066\u65b0\u3057\u3044\u5024\u3092\u8fd4\u3059\u3001\u540d\u524d\u4ed8\u304d\u306e\u5f0f\u3067\u3059\u3002SQL\u95a2\u6570\u306f\u6570\u5b66\u95a2\u6570\u306b\u4f3c\u305f\u3082\u306e\u3068\u8003\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001log(x)\u95a2\u6570\u306f\u5024x\u3092\u53d7\u3051\u53d6\u308a\u3001x\u306e\u5bfe\u6570\u3092\u8fd4\u3057\u307e\u3059\u3002.<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u3059\u3079\u3066\u306e\u66f8\u7c4d\u306e\u30bf\u30a4\u30c8\u30eb\u3068\u305d\u306e\u4fa1\u683c\u3092\u3001\u6700\u3082\u9ad8\u4fa1\u306a\u3082\u306e\u304b\u3089\u6700\u3082\u5b89\u4fa1\u306a\u3082\u306e\u306e\u9806\u306b\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT title, price, introduction_date FROM inventory ORDER BY price DESC;<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n+------------------------------------+-------+-------------------+\r\n| title | price | introduction_date |\r\n+------------------------------------+-------+-------------------+\r\n| Pride and Prejudice | 42.13 | 2022-10-04 |\r\n| The Adventures of Huckleberry Finn | 23.15 | 2022-10-01 |\r\n| The Time Machine | 21.99 | 2022-09-23 |\r\n| The Picture of Dorian Gray | 20.83 | 2022-10-01 |\r\n| Frankenstein | 17.43 | 2022-07-23 |\r\n+------------------------------------+-------+-------------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<\/div>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067\u306f\u3001 <code>\u30bf\u30a4\u30c8\u30eb<\/code>\u3001 <code>\u4fa1\u683c<\/code> \u305d\u3057\u3066 <code>\u5c0e\u5165\u65e5<\/code> \u306f\u5217\u540d\u3067\u3042\u308a\u3001\u51fa\u529b\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u5404\u66f8\u7c4d\u306b\u3064\u3044\u3066\u3053\u308c\u3089\u306e\u5217\u304b\u3089\u53d6\u5f97\u3055\u308c\u305f\u305d\u306e\u307e\u307e\u306e\u5024\uff08\u66f8\u7c4d\u306e\u5b8c\u5168\u306a\u30bf\u30a4\u30c8\u30eb\u3001\u4fa1\u683c\u3001\u66f8\u7c4d\u304c\u56f3\u66f8\u9928\u306b\u5230\u7740\u3057\u305f\u65e5\u4ed8\uff09\u3092\u8868\u793a\u3057\u307e\u3059\u3002.<\/p>\n<p>\u3057\u304b\u3057\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u4f55\u3089\u304b\u306e\u51e6\u7406\u3084\u64cd\u4f5c\u3092\u884c\u3063\u305f\u5f8c\u306b\u5024\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3082\u3042\u308b\u3067\u3057\u3087\u3046\u3002\u4f8b\u3048\u3070\u3001\u66f8\u7c4d\u306e\u4fa1\u683c\u3092\u6700\u3082\u8fd1\u3044\u30c9\u30eb\u306b\u4e38\u3081\u305f\u308a\u3001\u66f8\u7c4d\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u5927\u6587\u5b57\u3067\u8868\u793a\u3057\u305f\u308a\u3001\u6708\u3084\u65e5\u3092\u9664\u3044\u305f\u51fa\u7248\u5e74\u3092\u8868\u793a\u3057\u305f\u308a\u3057\u305f\u3044\u5834\u5408\u306a\u3069\u3067\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u5834\u5408\u306f\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002.<\/p>\n<p>SQL\u95a2\u6570\u306f\u3001\u64cd\u4f5c\u5bfe\u8c61\u3068\u306a\u308b\u30c7\u30fc\u30bf\u306e\u7a2e\u985e\u306b\u5fdc\u3058\u3066\u3001\u3044\u304f\u3064\u304b\u306e\u30b0\u30eb\u30fc\u30d7\u306b\u5927\u307e\u304b\u306b\u5206\u985e\u3067\u304d\u307e\u3059\u3002\u6700\u3082\u3088\u304f\u4f7f\u7528\u3055\u308c\u308b\u95a2\u6570\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u6570\u5b66\u95a2\u6570: \u6570\u5024\u3092\u64cd\u4f5c\u3057\u3066\u3001\u56db\u6368\u4e94\u5165\u3001\u5bfe\u6570\u3001\u5e73\u65b9\u6839\u3001\u7d2f\u4e57\u306a\u3069\u306e\u8a08\u7b97\u3092\u5b9f\u884c\u3059\u308b\u95a2\u6570\u3002.<\/li>\n<li>\u6587\u5b57\u5217\u64cd\u4f5c\u95a2\u6570: \u6587\u5b57\u5217\u304a\u3088\u3073\u30c6\u30ad\u30b9\u30c8 \u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u64cd\u4f5c\u3057\u3066\u3001\u30c6\u30ad\u30b9\u30c8\u3092\u5927\u6587\u5b57\u306b\u5909\u63db\u3057\u305f\u308a\u3001\u5207\u308a\u6368\u3066\u305f\u308a\u3001\u5024\u5185\u306e\u5358\u8a9e\u3092\u7f6e\u304d\u63db\u3048\u305f\u308a\u3059\u308b\u306a\u3069\u306e\u30c6\u30ad\u30b9\u30c8\u5909\u63db\u3092\u5b9f\u884c\u3059\u308b\u95a2\u6570\u3002.<\/li>\n<li>\u65e5\u4ed8\u3068\u6642\u523b\u306e\u95a2\u6570\uff1a\u65e5\u4ed8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u64cd\u4f5c\u3059\u308b\u95a2\u6570\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u306f\u3001\u7279\u5b9a\u306e\u65e5\u4ed8\u306b\u65e5\u6570\u3092\u52a0\u7b97\u3057\u305f\u308a\u3001\u65e5\u4ed8\u304b\u3089\u5e74\u6570\u3092\u6e1b\u7b97\u3057\u305f\u308a\u3059\u308b\u306a\u3069\u3001\u8a08\u7b97\u3084\u5909\u63db\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002.<\/li>\n<li>\u96c6\u8a08\u95a2\u6570: \u3059\u3079\u3066\u306e\u884c\u306e\u5e73\u5747\u4fa1\u683c\u3092\u8a08\u7b97\u3059\u308b\u306a\u3069\u3001\u8907\u6570\u306e\u884c\u304b\u3089\u53d6\u5f97\u3057\u305f\u5024\u306b\u5bfe\u3057\u3066\u6f14\u7b97\u3092\u884c\u3046\u6570\u5b66\u95a2\u6570\u306e\u7279\u6b8a\u306a\u30b1\u30fc\u30b9\u3002.<\/li>\n<\/ul>\n<p><span style=\"color: #ff0000;\">\u6ce8: MySQL\u3092\u542b\u3080\u307b\u3068\u3093\u3069\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u3001SQL\u6a19\u6e96\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u6a19\u6e96\u95a2\u6570\u30bb\u30c3\u30c8\u3092\u62e1\u5f35\u3057\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a8\u30f3\u30b8\u30f3\u56fa\u6709\u306e\u8ffd\u52a0\u64cd\u4f5c\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u6a19\u6e96SQL\u95a2\u6570\u30bb\u30c3\u30c8\u4ee5\u5916\u306e\u95a2\u6570\u306e\u591a\u304f\u306f\u3001\u591a\u304f\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u540c\u69d8\u306b\u52d5\u4f5c\u3057\u307e\u3059\u304c\u3001\u7279\u5b9a\u306eRDBMS\u3068\u305d\u306e\u56fa\u6709\u306e\u6a5f\u80fd\u306b\u56fa\u6709\u306e\u95a2\u6570\u3082\u3042\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u63d0\u4f9b\u3059\u308b\u95a2\u6570\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u9078\u629e\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002MySQL\u306e\u5834\u5408\u306f\u3001\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u3068\u6f14\u7b97\u5b50\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u3002.<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u4f8b\u306f\u3001\u67b6\u7a7a\u306e\u5b58\u5728\u3057\u306a\u3044\u95a2\u6570 EXAMPLE \u3092\u4f7f\u7528\u3057\u3066\u3001SELECT \u30af\u30a8\u30ea\u3067\u66f8\u5e97\u5728\u5eab\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u4fa1\u683c\u5024\u306e\u7d50\u679c\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u306e\u4e00\u822c\u7684\u306a\u69cb\u6587\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT EXAMPLE(price) AS new_price FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u95a2\u6570 (EXAMPLE) \u306f\u3001\u5217\u540d (price) \u3092\u62ec\u5f27\u3067\u56f2\u3093\u3060\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002\u30af\u30a8\u30ea\u306e\u3053\u306e\u90e8\u5206\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u5217\u5185\u306e\u4fa1\u683c\u5024\u306b\u5bfe\u3057\u3066 EXAMPLE \u95a2\u6570\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u64cd\u4f5c\u306e\u7d50\u679c\u3092\u8fd4\u3059\u3088\u3046\u306b\u6307\u793a\u3057\u307e\u3059\u3002AS new_price \u306f\u3001\u30af\u30a8\u30ea\u4e2d\u306b\u8a08\u7b97\u3055\u308c\u305f\u5024\u306b\u4e00\u6642\u7684\u306a\u540d\u524d (new_price) \u3092\u5272\u308a\u5f53\u3066\u308b\u3088\u3046\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u6307\u793a\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u51fa\u529b\u3067\u95a2\u6570\u306e\u7d50\u679c\u3092\u8b58\u5225\u3067\u304d\u3001WHERE \u53e5\u3068 ORDER BY \u53e5\u3092\u4f7f\u7528\u3057\u3066\u8a08\u7b97\u3055\u308c\u305f\u5024\u3092\u53c2\u7167\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u6570\u5b66\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u4e00\u822c\u7684\u306a\u8a08\u7b97\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002.<\/p>\n<h2 id=\"%d8%a7%d8%b3%d8%aa%d9%81%d8%a7%d8%af%d9%87-%d8%a7%d8%b2-%d8%aa%d9%88%d8%a7%d8%a8%d8%b9-%d8%b1%db%8c%d8%a7%d8%b6%db%8c\">\u6570\u5b66\u95a2\u6570\u306e\u4f7f\u7528<\/h2>\n<p>\u6570\u5b66\u95a2\u6570\u306f\u3001\u66f8\u7c4d\u306e\u4fa1\u683c\u3084\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u5728\u5eab\u6570\u306a\u3069\u306e\u6570\u5024\u3092\u64cd\u4f5c\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u3067\u8a08\u7b97\u3092\u5b9f\u884c\u3057\u3001\u30cb\u30fc\u30ba\u306b\u5408\u308f\u305b\u3066\u7d50\u679c\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u4e38\u3081\u306f\u3001SQL\u306b\u304a\u3051\u308b\u6570\u5b66\u95a2\u6570\u306e\u6700\u3082\u4e00\u822c\u7684\u306a\u7528\u9014\u306e\u4e00\u3064\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u3059\u3079\u3066\u306e\u66f8\u7c4d\u306e\u4fa1\u683c\u3092\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u5024\u3092\u6700\u3082\u8fd1\u3044\u30c9\u30eb\u306b\u4e38\u3081\u305f\u3044\u3068\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u6b21\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 <code>\u30e9\u30a6\u30f3\u30c9<\/code> \u4e38\u3081\u6f14\u7b97\u3092\u5b9f\u884c\u3059\u308b\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002.<\/p>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT title, price, ROUND(price) AS rounded_price FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n+------------------------------------+-------+---------------+\r\n| title | price | rounded_price |\r\n+------------------------------------+-------+---------------+\r\n| The Picture of Dorian Gray | 20.83 | 21 |\r\n| Pride and Prejudice | 42.13 | 42 |\r\n| The Time Machine | 21.99 | 22 |\r\n| Frankenstein | 17.43 | 17 |\r\n| The Adventures of Huckleberry Finn | 23.15 | 23 |\r\n+------------------------------------+-------+---------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u306f\u5217\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002 <code>\u30bf\u30a4\u30c8\u30eb<\/code> \u305d\u3057\u3066 <code>\u4fa1\u683c<\/code> \u4e00\u6642\u7684\u306a\u67f1\u3067 <code>\u4e38\u3081\u3089\u308c\u305f\u4fa1\u683c<\/code> \u3053\u308c\u306f\u95a2\u6570\u304b\u3089\u5f97\u3089\u308c\u308b <code>ROUND(\u4fa1\u683c)<\/code> \u3053\u306e\u95a2\u6570\u306f\u5217\u540d\uff08\u3053\u3053\u3067\u306f <code>\u4fa1\u683c<\/code>\uff09\u3092\u5b9f\u884c\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u305d\u306e\u5217\u306e\u5024\u3092\u6700\u3082\u8fd1\u3044\u6574\u6570\u306b\u4e38\u3081\u307e\u3059\u3002.<\/p>\n<p>ROUND\u95a2\u6570\u306f\u3001\u5217\u540d\u306e\u4ee3\u308f\u308a\u306b\u3001\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306e\u6841\u6570\u3084\u7b97\u8853\u6f14\u7b97\u3092\u6307\u5b9a\u3059\u308b\u305f\u3081\u306e\u8ffd\u52a0\u5f15\u6570\u3082\u53d7\u3051\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u6b21\u306e\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT title, price, ROUND(price * stock, 1) AS stock_price FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n+------------------------------------+-------+-------+-------------+\r\n| title | stock | price | stock_price |\r\n+------------------------------------+-------+-------+-------------+\r\n| The Picture of Dorian Gray | 4 | 20.83 | 83.3 |\r\n| Pride and Prejudice | 12 | 42.13 | 505.6 |\r\n| The Time Machine | 7 | 21.99 | 153.9 |\r\n| Frankenstein | 9 | 17.43 | 156.9 |\r\n| The Adventures of Huckleberry Finn | 14 | 23.15 | 324.1 |\r\n+------------------------------------+-------+-------+-------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<\/div>\n<p>\u5b9f\u884c <code>ROUND(\u4fa1\u683c * \u5728\u5eab, 1)<\/code> \u307e\u305a\u3001\u66f8\u7c4d1\u518a\u306e\u4fa1\u683c\u3068\u5728\u5eab\u6570\u3092\u639b\u3051\u5408\u308f\u305b\u3001\u305d\u306e\u7d50\u679c\u3092\u5c0f\u6570\u70b9\u7b2c1\u4f4d\u306b\u4e38\u3081\u307e\u3059\u3002\u7d50\u679c\u306f\u4e00\u6642\u5217Stock_Price\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002.<\/p>\n<p>MySQL\u306b\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u305d\u306e\u4ed6\u306e\u6570\u5b66\u95a2\u6570\u306b\u306f\u3001\u4e09\u89d2\u95a2\u6570\u3001\u5e73\u65b9\u6839\u3001\u7d2f\u4e57\u3001\u5bfe\u6570\u3001\u6307\u6570\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002SQL\u3067\u306e\u6570\u5b66\u95a2\u6570\u306e\u4f7f\u7528\u6cd5\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u306f\u3001\u300cSQL\u3067\u6570\u5f0f\u3068\u96c6\u8a08\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u300d\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002.<\/p>\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001SQL \u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u64cd\u4f5c\u3057\u307e\u3059\u3002.<\/p>\n<h2 id=\"%d8%a7%d8%b3%d8%aa%d9%81%d8%a7%d8%af%d9%87-%d8%a7%d8%b2-%d8%aa%d9%88%d8%a7%d8%a8%d8%b9-%d9%85%d8%aa%d9%86%db%8c\">\u30c6\u30ad\u30b9\u30c8\u95a2\u6570\u306e\u4f7f\u7528<\/h2>\n<p>SQL\u306e\u30c6\u30ad\u30b9\u30c8\u95a2\u6570\u306f\u3001\u6587\u5b57\u5217\u5024\u3092\u64cd\u4f5c\u3057\u305f\u308a\u5909\u66f4\u3057\u305f\u308a\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u66f8\u7c4d\u540d\u3092\u3001\u30bf\u30a4\u30c8\u30eb\u306e\u5148\u982d\u3068\u672b\u5c3e\u306b\u3042\u308b\u4f59\u5206\u306a\u30b9\u30da\u30fc\u30b9\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u6574\u7136\u3068\u3057\u305f\u5f62\u5f0f\u3067\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306a\u3069\u3067\u3059\u3002.<\/p>\n<p>\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059 <code>\u30c8\u30ea\u30e0<\/code> \u3053\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001\u6587\u5b57\u5217\u306e\u5148\u982d\u3068\u672b\u5c3e\u306b\u3042\u308b\u3059\u3079\u3066\u306e\u30b9\u30da\u30fc\u30b9\u3068\u4f59\u5206\u306a\u6587\u5b57\u3092\u524a\u9664\u3057\u307e\u3059\u3002.<\/p>\n<p>\u6b21\u306e\u4f8b\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT LOWER(title) AS title_lowercase FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u51fa\u529b\u304c\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n+------------------------------------+\r\n| title_lowercase |\r\n+------------------------------------+\r\n| the picture of dorian gray |\r\n| pride and prejudice |\r\n| the time machine |\r\n| frankenstein |\r\n| the adventures of huckleberry finn |\r\n+------------------------------------+\r\n5 rows in set (0.001 sec)\r\n<\/code><\/pre>\n<\/div>\n<p>SQL\u95a2\u6570LOWER\u306f\u3001\u5358\u4e00\u306e\u5f15\u6570\u3092\u53d7\u3051\u53d6\u308a\u3001\u305d\u306e\u5185\u5bb9\u3092\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3057\u307e\u3059\u3002\u30a8\u30a4\u30ea\u30a2\u30b9\u5217AS title_downcase\u3092\u4ecb\u3057\u3066\u3001\u7d50\u679c\u306e\u30c7\u30fc\u30bf\u306ftitle_downcase\u3068\u3044\u3046\u540d\u524d\u306e\u4e00\u6642\u5217\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002.<\/p>\n<p>\u4eca\u5ea6\u306f\u3059\u3079\u3066\u306e\u8457\u8005\u540d\u3092\u5927\u6587\u5b57\u306b\u5909\u63db\u3057\u3066\u53d6\u5f97\u3057\u307e\u3059\u3002\u6b21\u306eSQL\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT UPPER(author) AS author_uppercase FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n+----------------------+\r\n| author_uppercase |\r\n+----------------------+\r\n| OSCAR WILDE |\r\n| JANE AUSTEN |\r\n| HERBERT GEORGE WELLS |\r\n| MARY SHELLEY |\r\n| MARK TWAIN |\r\n+----------------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<\/div>\n<p>LOWER\u95a2\u6570\u306e\u4ee3\u308f\u308a\u306bUPPER\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002UPPER\u95a2\u6570\u306fLOWER\u95a2\u6570\u3068\u540c\u69d8\u306b\u52d5\u4f5c\u3057\u307e\u3059\u304c\u3001\u30c6\u30ad\u30b9\u30c8\u3092\u5927\u6587\u5b57\u306b\u5909\u63db\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u969b\u306b\u5927\u6587\u5b57\u3068\u5c0f\u6587\u5b57\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3061\u305f\u3044\u5834\u5408\u306f\u3001\u3069\u3061\u3089\u306e\u95a2\u6570\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u3082\u3046\u4e00\u3064\u306e\u4fbf\u5229\u306a\u6587\u5b57\u5217\u64cd\u4f5c\u95a2\u6570\u306fCONCAT\u3067\u3059\u3002\u3053\u306e\u95a2\u6570\u306f\u3001\u30c6\u30ad\u30b9\u30c8\u5024\u3092\u542b\u3080\u8907\u6570\u306e\u5f15\u6570\u3092\u53d7\u3051\u53d6\u308a\u3001\u305d\u308c\u3089\u3092\u9023\u7d50\u3057\u307e\u3059\u3002\u8a66\u3057\u306b\u3001\u8457\u8005\u540d\u3068\u66f8\u7c4d\u540d\u30921\u3064\u306e\u5217\u304b\u3089\u53d6\u5f97\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u6b21\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT CONCAT(author, ': ', title) AS full_title FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u6b21\u306e\u51fa\u529b\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\">Output\r\n+------------------------------------------------+\r\n| full_title |\r\n+------------------------------------------------+\r\n| Oscar Wilde: The Picture of Dorian Gray |\r\n| Jane Austen: Pride and Prejudice |\r\n| Herbert George Wells: The Time Machine |\r\n| Mary Shelley: Frankenstein |\r\n| Mark Twain: The Adventures of Huckleberry Finn |\r\n+------------------------------------------------+\r\n5 rows in set (0.001 sec)<\/pre>\n<\/div>\n<p>CONCAT\u95a2\u6570\u306f\u8907\u6570\u306e\u6587\u5b57\u5217\u3092\u9023\u7d50\u3057\u30013\u3064\u306e\u5f15\u6570\u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u6700\u521d\u306e\u5f15\u6570\u300cauthor\u300d\u306f\u3001\u8457\u8005\u540d\u3092\u542b\u3080\u5217\u300cauthor\u300d\u3092\u53c2\u7167\u3057\u307e\u3059\u30022\u756a\u76ee\u306e\u5f15\u6570\u300c:\u300d\u306f\u3001\u8457\u8005\u3068\u66f8\u7c4d\u540d\u3092\u30b3\u30ed\u30f3\u3067\u533a\u5207\u308b\u305f\u3081\u306e\u4efb\u610f\u306e\u6587\u5b57\u5217\u5024\u3067\u3059\u3002\u6700\u5f8c\u306e\u5f15\u6570\u300ctitle\u300d\u306f\u3001\u66f8\u7c4d\u540d\u3092\u542b\u3080\u5217\u300ctitle\u300d\u3092\u53c2\u7167\u3057\u307e\u3059\u3002.<\/p>\n<p>\u3053\u306e\u30af\u30a8\u30ea\u306e\u7d50\u679c\u3001\u8457\u8005\u3068\u30bf\u30a4\u30c8\u30eb\u306f full_title \u3068\u547c\u3070\u308c\u308b\u4e00\u6642\u5217\u306b\u8fd4\u3055\u308c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9 \u30a8\u30f3\u30b8\u30f3\u306b\u3088\u3063\u3066\u76f4\u63a5\u9023\u7d50\u3055\u308c\u307e\u3059\u3002.<\/p>\n<p>MySQL\u306b\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u305d\u306e\u4ed6\u306e\u6587\u5b57\u5217\u95a2\u6570\u306b\u306f\u3001\u6587\u5b57\u5217\u306e\u691c\u7d22\u3068\u7f6e\u63db\u3001\u90e8\u5206\u6587\u5b57\u5217\u306e\u53d6\u5f97\u3001\u6587\u5b57\u5217\u5024\u306e\u57cb\u3081\u8fbc\u307f\u3068\u30c8\u30ea\u30df\u30f3\u30b0\u3001\u6b63\u898f\u8868\u73fe\u306e\u9069\u7528\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002SQL\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u8907\u6570\u306e\u5024\u3092\u9023\u7d50\u3059\u308b\u65b9\u6cd5\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u300cSQL\u3067CAST\u95a2\u6570\u3068\u9023\u7d50\u5f0f\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5\u300d\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001MySQL\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u300c\u6587\u5b57\u5217\u95a2\u6570\u3068\u6f14\u7b97\u5b50\u300d\u3082\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002.<\/p>\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001SQL \u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u65e5\u4ed8\u3092\u64cd\u4f5c\u3057\u307e\u3059\u3002.<\/p>\n<h2 id=\"%d8%a7%d8%b3%d8%aa%d9%81%d8%a7%d8%af%d9%87-%d8%a7%d8%b2-%d8%aa%d9%88%d8%a7%d8%a8%d8%b9-%d8%aa%d8%a7%d8%b1%db%8c%d8%ae-%d9%88-%d8%b2%d9%85%d8%a7%d9%86\">\u65e5\u4ed8\u3068\u6642\u523b\u95a2\u6570\u306e\u4f7f\u7528<\/h2>\n<p>SQL\u306e\u65e5\u4ed8\u3068\u6642\u523b\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001SQL\u30af\u30a8\u30ea\u306e\u51e6\u7406\u4e2d\u306b\u65e5\u4ed8\u3068\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3092\u4fdd\u6301\u3059\u308b\u5217\u306b\u683c\u7d0d\u3055\u308c\u305f\u5024\u3092\u64cd\u4f5c\u3067\u304d\u307e\u3059\u3002\u65e5\u4ed8\u60c5\u5831\u306e\u4e00\u90e8\u3092\u62bd\u51fa\u3057\u305f\u308a\u3001\u65e5\u4ed8\u8a08\u7b97\u3092\u5b9f\u884c\u3057\u305f\u308a\u3001\u65e5\u4ed8\u3068\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3092\u5fc5\u8981\u306a\u51fa\u529b\u5f62\u5f0f\u306b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3057\u305f\u308a\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u51fa\u529b\u306b\u5358\u4e00\u306e\u65e5\u4ed8\u5217\u3092\u542b\u3081\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u672c\u306e\u51fa\u7248\u65e5\u3092\u5e74\u3001\u6708\u3001\u65e5\u306b\u500b\u5225\u306b\u5206\u5272\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3068\u3057\u307e\u3059\u3002.<\/p>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT introduction_date, YEAR(introduction_date) as year, MONTH(introduction_date) as month, DAY(introduction_date) as day FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n+-------------------+------+-------+------+\r\n| introduction_date | year | month | day |\r\n+-------------------+------+-------+------+\r\n| 2022-10-01 | 2022 | 10 | 1 |\r\n| 2022-10-04 | 2022 | 10 | 4 |\r\n| 2022-09-23 | 2022 | 9 | 23 |\r\n| 2022-07-23 | 2022 | 7 | 23 |\r\n| 2022-10-01 | 2022 | 10 | 1 |\r\n+-------------------+------+-------+------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<\/div>\n<p>\u3053\u306eSQL\u6587\u306f\u3001YEAR\u3001MONTH\u3001DAY\u3068\u3044\u30463\u3064\u306e\u72ec\u7acb\u3057\u305f\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u5404\u95a2\u6570\u306f\u3001\u65e5\u4ed8\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u5217\u306e\u540d\u524d\u3092\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u53d6\u308a\u3001\u65e5\u4ed8\u5168\u4f53\u306e\u3046\u3061\u3001\u305d\u308c\u305e\u308c\u5e74\u3001\u6708\u3001\u65e5\u306e\u3044\u305a\u308c\u304b1\u3064\u306e\u90e8\u5206\u306e\u307f\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001SQL\u30af\u30a8\u30ea\u3067\u65e5\u4ed8\u306e\u500b\u3005\u306e\u90e8\u5206\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u65e5\u4ed8\u3092\u64cd\u4f5c\u3059\u308b\u306e\u306b\u4fbf\u5229\u306a\u95a2\u6570\u3068\u3057\u3066\u3001DATEDIFF\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u3092\u4f7f\u3046\u3068\u30012\u3064\u306e\u65e5\u4ed8\u9593\u306e\u65e5\u6570\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u3067\u306f\u3001\u5404\u66f8\u7c4d\u304c\u51fa\u7248\u3055\u308c\u305f\u65e5\u304b\u3089\u73fe\u5728\u306e\u65e5\u4ed8\u307e\u3067\u306e\u9593\u306b\u4f55\u65e5\u304c\u7d4c\u904e\u3057\u305f\u304b\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002.<\/p>\n<p>\u6b21\u306e\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT introduction_date, DATEDIFF(introduction_date, CURRENT_DATE()) AS days_since FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u6b21\u306e\u51fa\u529b\u304c\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n+-------------------+------------+\r\n| introduction_date | days_since |\r\n+-------------------+------------+\r\n| 2022-10-01 | -30 |\r\n| 2022-10-04 | -27 |\r\n| 2022-09-23 | -38 |\r\n| 2022-07-23 | -100 |\r\n| 2022-10-01 | -30 |\r\n+-------------------+------------+\r\n5 rows in set (0.000 sec)<\/code><\/pre>\n<\/div>\n<p>DATEDIFF\u95a2\u6570\u306f\u3001\u958b\u59cb\u65e5\u3068\u7d42\u4e86\u65e5\u306e2\u3064\u306e\u5f15\u6570\u3092\u53d6\u308a\u307e\u3059\u3002DATEDIFF\u95a2\u6570\u306f\u3001\u3053\u308c\u30892\u3064\u306e\u6642\u70b9\u9593\u306e\u65e5\u6570\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002\u7d42\u4e86\u65e5\u306e\u65b9\u304c\u65e9\u3044\u5834\u5408\u3001\u7d50\u679c\u306f\u8ca0\u306e\u6570\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001\u6700\u521d\u306e\u5f15\u6570\u306finventory\u30c6\u30fc\u30d6\u30eb\u306e\u65e5\u4ed8\u3092\u4fdd\u6301\u3059\u308bintroduction_date\u5217\u306e\u540d\u524d\u3067\u3059\u30022\u756a\u76ee\u306e\u5f15\u6570\u306fCURRENT_DATE\u3068\u3044\u3046\u5225\u306e\u95a2\u6570\u3067\u3001\u73fe\u5728\u306e\u30b7\u30b9\u30c6\u30e0\u65e5\u4ed8\u3092\u8868\u3057\u307e\u3059\u3002\u3053\u306e\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u3053\u308c\u30892\u3064\u306e\u6642\u70b9\u9593\u306e\u65e5\u6570\u304c\u53d6\u5f97\u3055\u308c\u3001\u305d\u306e\u7d50\u679c\u306fdays_since\u3068\u3044\u3046\u4e00\u6642\u5217\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002.<\/p>\n<p><span style=\"color: #ff0000;\">\u6ce8: DATEDIFF \u306f\u516c\u5f0f\u306eSQL\u6a19\u6e96\u95a2\u6570\u30bb\u30c3\u30c8\u306b\u306f\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u591a\u304f\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u3053\u306e\u95a2\u6570\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u69cb\u6587\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a8\u30f3\u30b8\u30f3\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u4f8b\u306fMySQL\u306e\u30cd\u30a4\u30c6\u30a3\u30d6\u69cb\u6587\u306b\u5f93\u3063\u3066\u3044\u307e\u3059\u3002.<\/span><\/p>\n<p>MySQL\u306b\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u305d\u306e\u4ed6\u306e\u65e5\u4ed8\u64cd\u4f5c\u95a2\u6570\u306b\u306f\u3001\u6642\u9593\u9593\u9694\u3084\u65e5\u4ed8\u306e\u52a0\u7b97\u3068\u6e1b\u7b97\u3001\u69d8\u3005\u306a\u8a00\u8a9e\u5f62\u5f0f\u3078\u306e\u65e5\u4ed8\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3001\u66dc\u65e5\u3068\u6708\u306e\u540d\u524d\u306e\u53d6\u5f97\u3001\u65b0\u3057\u3044\u65e5\u4ed8\u5024\u306e\u4f5c\u6210\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002SQL\u3067\u306e\u65e5\u4ed8\u64cd\u4f5c\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u300cSQL\u3067\u65e5\u4ed8\u3068\u6642\u523b\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5\u300d\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001MySQL\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u65e5\u4ed8\u3068\u6642\u523b\u95a2\u6570\u3082\u53c2\u7167\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u96c6\u8a08\u95a2\u6570\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u5b66\u7fd2\u3057\u307e\u3059\u3002.<\/p>\n<h2 id=\"%d8%a7%d8%b3%d8%aa%d9%81%d8%a7%d8%af%d9%87-%d8%a7%d8%b2-%d8%aa%d9%88%d8%a7%d8%a8%d8%b9-%d8%ac%d9%85%d8%b9\">\u96c6\u8a08\u95a2\u6570\u306e\u4f7f\u7528<\/h2>\n<p>\u3053\u308c\u307e\u3067\u306e\u3059\u3079\u3066\u306e\u4f8b\u3067\u306f\u3001SQL\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001\u66f8\u5e97\u306b\u3042\u308b\u672c\u3092\u8868\u3059\u884c\u5185\u306e\u500b\u3005\u306e\u5217\u306e\u5024\u306b\u5909\u63db\u307e\u305f\u306f\u8a08\u7b97\u3092\u9069\u7528\u3057\u307e\u3057\u305f\u3002SQL\u306f\u3001\u8907\u6570\u306e\u884c\u306b\u5bfe\u3057\u3066\u6570\u5b66\u7684\u8a08\u7b97\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u63d0\u4f9b\u3057\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5168\u4f53\u306e\u96c6\u8a08\u60c5\u5831\u3092\u898b\u3064\u3051\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002.<\/p>\n<ul>\n<li>SQL \u306e\u57fa\u672c\u7684\u306a\u96c6\u8a08\u95a2\u6570\u306b\u306f\u6b21\u306e\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<li>\u8a08\u7b97\u304c\u5b9f\u884c\u3055\u308c\u308b\u5024\u306e\u5e73\u5747\u3092\u8868\u3059 AVG \u3067\u3059\u3002.<\/li>\n<li>\u8a08\u7b97\u304c\u5b9f\u884c\u3055\u308c\u308b\u5024\u306e\u6570\u3092COUNT\u3057\u307e\u3059\u3002.<\/li>\n<li>\u6700\u5927\u5024\u306fMAX\u3002.<\/li>\n<li>\u6700\u5c0f\u5024\u306e\u5834\u5408\u306f MIN\u3002.<\/li>\n<li>\u3059\u3079\u3066\u306e\u5024\u306e\u5408\u8a08\u3092\u6c42\u3081\u308b SUM\u3002.<\/li>\n<\/ul>\n<p>SELECT\u30af\u30a8\u30ea\u306b\u306f\u8907\u6570\u306e\u96c6\u8a08\u95a2\u6570\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u66f8\u5e97\u306b\u4e26\u3093\u3067\u3044\u308b\u672c\u306e\u518a\u6570\u3001\u5404\u672c\u306e\u6700\u9ad8\u4fa1\u683c\u3001\u305d\u3057\u3066\u30ab\u30bf\u30ed\u30b0\u5168\u4f53\u306e\u5e73\u5747\u4fa1\u683c\u3092\u8abf\u3079\u305f\u3044\u3068\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u6b21\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>SELECT COUNT(title) AS count, MAX(price) AS max_price, AVG(price) AS avg_price FROM inventory;\r\n<\/code><\/pre>\n<\/div>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u6b21\u306e\u51fa\u529b\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Output\r\n+-------+-----------+-----------+\r\n| count | max_price | avg_price |\r\n+-------+-----------+-----------+\r\n| 5 | 42.13 | 25.106000 |\r\n+-------+-----------+-----------+\r\n1 row in set (0.001 sec)<\/code><\/pre>\n<\/div>\n<p>\u4e0a\u8a18\u306e\u30af\u30a8\u30ea\u3067\u306f\u30013\u3064\u306e\u96c6\u8a08\u95a2\u6570\u3092\u540c\u6642\u306b\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002COUNT\u95a2\u6570\u306f\u3001\u30af\u30a8\u30ea\u304c\u691c\u7d22\u3059\u308b\u884c\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\u30bf\u30a4\u30c8\u30eb\u3092\u5f15\u6570\u3068\u3057\u3066\u6e21\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u30de\u30fc\u30af\u3055\u308c\u305f\u5217\u3054\u3068\u306b\u884c\u6570\u306f\u540c\u3058\u306a\u306e\u3067\u3001\u95a2\u6570\u306e\u5f15\u6570\u3068\u3057\u3066\u4ed6\u306e\u5217\u540d\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002MAX\u95a2\u6570\u306f\u3001price\u5217\u306e\u6700\u5927\u5024\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u3001\u5217\u540d\u306f\u91cd\u8981\u3067\u3059\u3002\u8a08\u7b97\u306f\u3001\u305d\u306e\u5217\u306e\u5024\u306b\u5bfe\u3057\u3066\u5b9f\u884c\u3055\u308c\u308b\u305f\u3081\u3067\u3059\u3002\u6700\u5f8c\u306e\u95a2\u6570\u306fAVG\u95a2\u6570\u3067\u3001price\u5217\u306e\u3059\u3079\u3066\u306e\u4fa1\u683c\u306e\u5e73\u5747\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002.<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u96c6\u8a08\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u96c6\u8a08\u8a08\u7b97\u306e\u5024\u3092\u8868\u3059\u4e00\u6642\u5217\u3092\u542b\u3080\u884c\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u8fd4\u3055\u308c\u307e\u3059\u3002\u30bd\u30fc\u30b9\u884c\u306f\u8a08\u7b97\u306b\u5185\u90e8\u7684\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u304c\u3001\u30af\u30a8\u30ea\u304b\u3089\u306f\u8fd4\u3055\u308c\u307e\u305b\u3093\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001\u96c6\u8a08\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u5728\u5eab\u30c6\u30fc\u30d6\u30eb\u5168\u4f53\u306e\u7d71\u8a08\u5024\u3092\u4e00\u5ea6\u306b\u8a08\u7b97\u3057\u3001\u3059\u3079\u3066\u306e\u884c\u3092\u96c6\u8a08\u306b\u8003\u616e\u3057\u3066\u3044\u307e\u3059\u3002.<\/p>\n<p>SQL\u3067\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u884c\u3092\u30b0\u30eb\u30fc\u30d7\u306b\u5206\u5272\u3057\u3001\u5404\u30b0\u30eb\u30fc\u30d7\u306e\u5408\u8a08\u3092\u500b\u5225\u306b\u8a08\u7b97\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u7570\u306a\u308b\u8457\u8005\u306e\u66f8\u7c4d\u306e\u5e73\u5747\u4fa1\u683c\u3092\u8a08\u7b97\u3057\u3066\u3001\u3069\u306e\u8457\u8005\u304c\u6700\u3082\u9ad8\u4fa1\u306a\u66f8\u7c4d\u3092\u51fa\u7248\u3057\u305f\u304b\u3092\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u8a08\u7b97\u306e\u305f\u3081\u306e\u884c\u306e\u30b0\u30eb\u30fc\u30d7\u5316\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u300cSQL\u3067GROUP BY\u3068ORDER BY\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u300d\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001\u96c6\u8a08\u306e\u4f7f\u7528\u6cd5\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u300cSQL\u3067\u6570\u5f0f\u3068\u96c6\u8a08\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u300d\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002.<\/p>\n<h2 id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\">\u7d50\u679c<\/h2>\n<p>\u3053\u306e\u30ac\u30a4\u30c9\u3067\u306f\u3001SQL\u306e\u95a2\u6570\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u306e\u8a08\u7b97\u3092\u884c\u3044\u3001\u3088\u308a\u8907\u96d1\u306a\u30af\u30a8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3092\u5b66\u3073\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u306f\u3001\u69d8\u3005\u306a\u65b9\u6cd5\u3067\u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3057\u3001\u3088\u308a\u826f\u3044\u7d50\u679c\u3092\u5f97\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002SQL\u306e\u6b63\u78ba\u306a\u69cb\u6587\u306f\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\uff08RDBMS\uff09\u306e\u7a2e\u985e\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308b\u3053\u3068\u306b\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002.<\/p>","protected":false},"excerpt":{"rendered":"\u306f\u3058\u3081\u306b \u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u69cb\u9020\u5316\u30af\u30a8\u30ea\u8a00\u8a9e (SQL) \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u6b21\u306e\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u2026","protected":false},"author":1,"featured_media":16374,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 SQL","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_canonical":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_opengraph-image":"","_yoast_wpseo_twitter-description":"","_yoast_wpseo_twitter-image":"","_yoast_wpseo_focuskeywords":"","_yoast_wpseo_primary_category":"193","footnotes":""},"categories":[193,349],"tags":[403,456],"class_list":{"0":"post-16372","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials","8":"category-database","9":"tag-data-base","10":"tag-sql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u062f\u0631 SQL - \u0628\u0644\u0627\u06af ITPiran<\/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.itpiran.net\/blog\/ja\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u062f\u0631 SQL - \u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"og:description\" content=\"\u0645\u0642\u062f\u0645\u0647 \u0647\u0646\u06af\u0627\u0645 \u06a9\u0627\u0631 \u0628\u0627 \u067e\u0627\u06cc\u06af\u0627\u0647\u200c\u0647\u0627\u06cc \u062f\u0627\u062f\u0647 \u0631\u0627\u0628\u0637\u0647\u200c\u0627\u06cc \u0648 \u0632\u0628\u0627\u0646 \u067e\u0631\u0633 \u0648 \u062c\u0648 \u0633\u0627\u062e\u062a\u0627\u0631 \u06cc\u0627\u0641\u062a\u0647 (SQL)\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0631\u0627&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itpiran.net\/blog\/ja\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-14T22:34:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.itpiran.net\/2024\/11\/15020231\/functionsInSql.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1793\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\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=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\"},\"headline\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u062f\u0631 SQL\",\"datePublished\":\"2024-11-14T22:34:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/\"},\"wordCount\":142,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/11\\\/15020231\\\/functionsInSql.jpg\",\"keywords\":[\"data base\",\"SQL\"],\"articleSection\":[\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/\",\"name\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u062f\u0631 SQL - \u0628\u0644\u0627\u06af ITPiran\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/11\\\/15020231\\\/functionsInSql.jpg\",\"datePublished\":\"2024-11-14T22:34:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/11\\\/15020231\\\/functionsInSql.jpg\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/11\\\/15020231\\\/functionsInSql.jpg\",\"width\":1793,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-use-functions-in-sqlusing-date-and-time-functions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/category\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u062f\u0631 SQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"name\":\"\u0628\u0644\u0627\u06af ITPiran\",\"description\":\"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\",\"name\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"alternateName\":\"ITPIran Blog\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"width\":512,\"height\":512,\"caption\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\",\"name\":\"admin\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/ja\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL\u95a2\u6570\u306e\u4f7f\u3044\u65b9 - ITPiran\u30d6\u30ed\u30b0","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.itpiran.net\/blog\/ja\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/","og_locale":"ja_JP","og_type":"article","og_title":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u062f\u0631 SQL - \u0628\u0644\u0627\u06af ITPiran","og_description":"\u0645\u0642\u062f\u0645\u0647 \u0647\u0646\u06af\u0627\u0645 \u06a9\u0627\u0631 \u0628\u0627 \u067e\u0627\u06cc\u06af\u0627\u0647\u200c\u0647\u0627\u06cc \u062f\u0627\u062f\u0647 \u0631\u0627\u0628\u0637\u0647\u200c\u0627\u06cc \u0648 \u0632\u0628\u0627\u0646 \u067e\u0631\u0633 \u0648 \u062c\u0648 \u0633\u0627\u062e\u062a\u0627\u0631 \u06cc\u0627\u0641\u062a\u0647 (SQL)\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0631\u0627&hellip;","og_url":"https:\/\/www.itpiran.net\/blog\/ja\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/","og_site_name":"\u0628\u0644\u0627\u06af ITPiran","article_published_time":"2024-11-14T22:34:07+00:00","og_image":[{"width":1793,"height":1110,"url":"https:\/\/cdn.itpiran.net\/2024\/11\/15020231\/functionsInSql.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"admin","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"3\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/#article","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/"},"author":{"name":"admin","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81"},"headline":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u062f\u0631 SQL","datePublished":"2024-11-14T22:34:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/"},"wordCount":142,"commentCount":0,"publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/11\/15020231\/functionsInSql.jpg","keywords":["data base","SQL"],"articleSection":["\u0622\u0645\u0648\u0632\u0634\u06cc","\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/","url":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/","name":"SQL\u95a2\u6570\u306e\u4f7f\u3044\u65b9 - ITPiran\u30d6\u30ed\u30b0","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/#primaryimage"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/11\/15020231\/functionsInSql.jpg","datePublished":"2024-11-14T22:34:07+00:00","breadcrumb":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/#primaryimage","url":"https:\/\/cdn.itpiran.net\/2024\/11\/15020231\/functionsInSql.jpg","contentUrl":"https:\/\/cdn.itpiran.net\/2024\/11\/15020231\/functionsInSql.jpg","width":1793,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-use-functions-in-sqlusing-date-and-time-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itpiran.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0622\u0645\u0648\u0632\u0634\u06cc","item":"https:\/\/www.itpiran.net\/blog\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u062f\u0631 SQL"}]},{"@type":"WebSite","@id":"https:\/\/www.itpiran.net\/blog\/#website","url":"https:\/\/www.itpiran.net\/blog\/","name":"ITPiran\u30d6\u30ed\u30b0","description":"\u30a4\u30e9\u30f3\u306e\u6301\u7d9a\u53ef\u80fd\u306a\u8cbf\u6613\u306b\u95a2\u3059\u308b\u30cb\u30e5\u30fc\u30b9\u3068\u8a18\u4e8b","publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itpiran.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.itpiran.net\/blog\/#organization","name":"\u6301\u7d9a\u53ef\u80fd\u306a\u30a4\u30e9\u30f3\u30d3\u30b8\u30cd\u30b9\u30d6\u30ed\u30b0","alternateName":"ITPIran Blog","url":"https:\/\/www.itpiran.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","contentUrl":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","width":512,"height":512,"caption":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81","name":"\u7ba1\u7406\u8005","url":"https:\/\/www.itpiran.net\/blog\/ja\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/posts\/16372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/comments?post=16372"}],"version-history":[{"count":2,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/posts\/16372\/revisions"}],"predecessor-version":[{"id":16375,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/posts\/16372\/revisions\/16375"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/media\/16374"}],"wp:attachment":[{"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/media?parent=16372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/categories?post=16372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/tags?post=16372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}