{"id":6502,"date":"2026-04-28T10:18:10","date_gmt":"2026-04-28T01:18:10","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/?post_type=route&#038;p=6502"},"modified":"2026-10-28T10:19:00","modified_gmt":"2026-10-28T01:19:00","slug":"sql-running-total-sum-over","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/6502\/","title":{"rendered":"SQL\u306e\u7d2f\u7a4d\u5408\u8a08\u3092SUM OVER\u3067\u8a08\u7b97\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u58f2\u4e0a\u30c7\u30fc\u30bf\u3092\u65e5\u4ed8\u9806\u306b\u4e26\u3079\u3066\u3001\u300c\u305d\u306e\u6642\u70b9\u307e\u3067\u306e\u5408\u8a08\u300d\u3092\u884c\u3054\u3068\u306b\u8868\u793a\u3057\u305f\u3044\u3002`GROUP BY`\u3067\u5408\u8a08\u3092\u51fa\u3059\u3068\u660e\u7d30\u884c\u304c\u307e\u3068\u307e\u3063\u3066\u3057\u307e\u3044\u3001\u601d\u3063\u305f\u5f62\u306b\u306a\u3089\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 \u660e\u7d30\u884c\u3092\u6b8b\u3057\u3066\u7d2f\u7a4d\u5408\u8a08\u3092\u4ed8\u3051\u308b\u306a\u3089\u3001`SUM(\u91d1\u984d) OVER (ORDER BY \u4e26\u3073\u9806 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)`\u3092\u4f7f\u3044\u307e\u3059\u3002 \u30c1\u30fc\u30e0\u5225\u306b\u8a08\u7b97\u3057\u305f\u3051\u308c\u3070`PARTITION BY`\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306fPostgreSQL\u3092\u4e2d\u5fc3\u306b\u3001\u540c\u3058\u65e5\u4ed8\u306e\u30c7\u30fc\u30bf\u304c\u8907\u6570\u3042\u308b\u5834\u5408\u306e\u6ce8\u610f\u70b9\u307e\u3067\u3001\u5b9f\u884c\u3067\u304d\u308bSQL\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<h2>\u307e\u305a\u306fSUM OVER\u3067\u7d2f\u7a4d\u5408\u8a08\u3092\u51fa\u3059<\/h2>\n<p>\u4f8b\u3068\u3057\u3066\u3001\u65e5\u4ed8\u30fb\u30c1\u30fc\u30e0\u30fb\u58f2\u4e0a\u91d1\u984d\u3092\u6301\u3064`sales`\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u3044\u307e\u3059\u3002\u91d1\u984d\u306f\u8aac\u660e\u7528\u306e\u67b6\u7a7a\u30c7\u30fc\u30bf\u3067\u3059\u3002<\/p>\n<pre><code>CREATE TABLE sales (\r\n    sale_id  INTEGER PRIMARY KEY,\r\n    sold_on  DATE NOT NULL,\r\n    team     VARCHAR(20) NOT NULL,\r\n    amount   INTEGER NOT NULL\r\n);\r\n\r\nINSERT INTO sales (sale_id, sold_on, team, amount) VALUES\r\n(1, &#39;2026-01-05&#39;, &#39;\u55b6\u696dA&#39;, 100),\r\n(2, &#39;2026-01-05&#39;, &#39;\u55b6\u696dA&#39;, 200),\r\n(3, &#39;2026-01-06&#39;, &#39;\u55b6\u696dA&#39;, 150),\r\n(4, &#39;2026-01-05&#39;, &#39;\u55b6\u696dB&#39;,  90),\r\n(5, &#39;2026-01-06&#39;, &#39;\u55b6\u696dB&#39;,  60);<\/code><\/pre>\n<p>\u30c1\u30fc\u30e0\u306e\u533a\u5225\u3092\u305b\u305a\u3001\u5168\u4f53\u30671\u884c\u305a\u3064\u7a4d\u307f\u4e0a\u3052\u308b\u5834\u5408\u306f\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n<pre><code>SELECT\r\n    sale_id, sold_on, team, amount,\r\n    SUM(amount) OVER (\r\n        ORDER BY sold_on, sale_id\r\n        ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW\r\n    ) AS running_total\r\nFROM sales\r\nORDER BY sold_on, sale_id;<\/code><\/pre>\n<p>\u7d50\u679c\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>sale_id<\/th>\n<th>\u65e5\u4ed8<\/th>\n<th>\u30c1\u30fc\u30e0<\/th>\n<th>\u91d1\u984d<\/th>\n<th>\u7d2f\u7a4d\u5408\u8a08<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>2026-01-05<\/td>\n<td>\u55b6\u696dA<\/td>\n<td>100<\/td>\n<td>100<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>2026-01-05<\/td>\n<td>\u55b6\u696dA<\/td>\n<td>200<\/td>\n<td>300<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>2026-01-05<\/td>\n<td>\u55b6\u696dB<\/td>\n<td>90<\/td>\n<td>390<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>2026-01-06<\/td>\n<td>\u55b6\u696dA<\/td>\n<td>150<\/td>\n<td>540<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>2026-01-06<\/td>\n<td>\u55b6\u696dB<\/td>\n<td>60<\/td>\n<td>600<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>`OVER`\u306f\u3001\u3069\u306e\u884c\u3092\u96c6\u8a08\u5bfe\u8c61\u306b\u3059\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002`ORDER BY sold_on, sale_id`\u3067\u8a08\u7b97\u9806\u3092\u6c7a\u3081\u3001`ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW`\u3067\u300c\u5148\u982d\u884c\u304b\u3089\u73fe\u5728\u884c\u307e\u3067\u300d\u3092\u5408\u8a08\u3057\u307e\u3059\u3002`sale_id`\u307e\u3067\u4e26\u3073\u9806\u306b\u542b\u3081\u3066\u3044\u308b\u306e\u306f\u3001\u540c\u3058\u65e5\u4ed8\u306e\u884c\u306e\u9806\u5e8f\u3092\u78ba\u5b9a\u3059\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001`OVER`\u5185\u306e`ORDER BY`\u306f<strong>\u8a08\u7b97\u9806<\/strong>\u3001\u6700\u5f8c\u306e`ORDER BY`\u306f<strong>\u8868\u793a\u9806<\/strong>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7d50\u679c\u306e\u898b\u305b\u65b9\u3082\u56fa\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u4e21\u65b9\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n<hr>\n<h2>GROUP BY\u3068\u306e\u9055\u3044\u306f\u300c\u660e\u7d30\u884c\u3092\u6b8b\u305b\u308b\u304b\u300d<\/h2>\n<p>\u901a\u5e38\u306e\u96c6\u8a08\u3067\u306f\u3001\u6b21\u306e\u3088\u3046\u306b`GROUP BY`\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><code>SELECT team, SUM(amount) AS total_amount\r\nFROM sales\r\nGROUP BY team\r\nORDER BY team;<\/code><\/pre>\n<p>\u7d50\u679c\u306f\u300c\u55b6\u696dA\uff1d450\u300d\u300c\u55b6\u696dB\uff1d150\u300d\u306e2\u884c\u3067\u3059\u3002\u5143\u306e5\u884c\u306f\u30c1\u30fc\u30e0\u3054\u3068\u306b\u307e\u3068\u3081\u3089\u308c\u307e\u3059\u3002\u4e00\u65b9\u3001`SUM(&#8230;) OVER (&#8230;)`\u306a\u3089\u5143\u306e\u660e\u7d305\u884c\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u3001\u5404\u884c\u306b\u8a08\u7b97\u7d50\u679c\u3092\u52a0\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u6b32\u3057\u3044\u7d50\u679c<\/th>\n<th>\u9069\u3057\u305f\u66f8\u304d\u65b9<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u30c1\u30fc\u30e0\u3054\u3068\u306e\u5408\u8a08\u30921\u884c\u305a\u3064<\/td>\n<td>`GROUP BY team`<\/td>\n<\/tr>\n<tr>\n<td>\u5404\u58f2\u4e0a\u660e\u7d30\u3092\u6b8b\u3057\u305f\u7d2f\u7a4d\u5408\u8a08<\/td>\n<td>`SUM(amount) OVER (ORDER BY &#8230;)`<\/td>\n<\/tr>\n<tr>\n<td>\u660e\u7d30\u3092\u6b8b\u3057\u305f\u30c1\u30fc\u30e0\u5225\u7d2f\u7a4d\u5408\u8a08<\/td>\n<td>`SUM(amount) OVER (PARTITION BY team ORDER BY &#8230;)`<\/td>\n<\/tr>\n<tr>\n<td>\u65e5\u5225\u5408\u8a08\u3092\u4f5c\u3063\u3066\u304b\u3089\u7d2f\u7a4d<\/td>\n<td>\u65e5\u5225`GROUP BY`\u306e\u7d50\u679c\u306b`SUM(&#8230;) OVER`<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\uff08GROUP BY\u306e\u57fa\u672c\u3084WHERE\u30fbHAVING\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1870\/\">GROUP BY\u4f7f\u3044\u65b9\u5b8c\u5168\u89e3\u8aac<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<hr>\n<h2>PARTITION BY\u3067\u30c1\u30fc\u30e0\u3054\u3068\u306b\u7d2f\u7a4d\u3092\u30ea\u30bb\u30c3\u30c8\u3059\u308b<\/h2>\n<p>\u5168\u793e\u5408\u8a08\u3067\u306f\u306a\u304f\u3001\u30c1\u30fc\u30e0\u3054\u3068\u306b\u58f2\u4e0a\u3092\u7a4d\u307f\u4e0a\u3052\u305f\u3044\u306a\u3089`PARTITION BY team`\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre><code>SELECT\r\n    sale_id, sold_on, team, amount,\r\n    SUM(amount) OVER (\r\n        PARTITION BY team\r\n        ORDER BY sold_on, sale_id\r\n        ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW\r\n    ) AS team_running_total\r\nFROM sales\r\nORDER BY team, sold_on, sale_id;<\/code><\/pre>\n<table>\n<thead>\n<tr>\n<th>\u30c1\u30fc\u30e0<\/th>\n<th>sale_id<\/th>\n<th>\u91d1\u984d<\/th>\n<th>\u30c1\u30fc\u30e0\u5185\u7d2f\u7a4d<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u55b6\u696dA<\/td>\n<td>1<\/td>\n<td>100<\/td>\n<td>100<\/td>\n<\/tr>\n<tr>\n<td>\u55b6\u696dA<\/td>\n<td>2<\/td>\n<td>200<\/td>\n<td>300<\/td>\n<\/tr>\n<tr>\n<td>\u55b6\u696dA<\/td>\n<td>3<\/td>\n<td>150<\/td>\n<td>450<\/td>\n<\/tr>\n<tr>\n<td>\u55b6\u696dB<\/td>\n<td>4<\/td>\n<td>90<\/td>\n<td>90<\/td>\n<\/tr>\n<tr>\n<td>\u55b6\u696dB<\/td>\n<td>5<\/td>\n<td>60<\/td>\n<td>150<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>`PARTITION BY`\u306f\u96c6\u8a08\u306e\u533a\u5207\u308a\u3067\u3059\u3002\u55b6\u696dA\u306e\u7d2f\u7a4d\u306f\u55b6\u696dB\u3078\u6301\u3061\u8d8a\u3055\u308c\u307e\u305b\u3093\u3002\u6708\u5225\u3001\u5e97\u8217\u5225\u3001\u62c5\u5f53\u8005\u5225\u306e\u3088\u3046\u306b\u300c\u533a\u5207\u308a\u3054\u3068\u306b\u7d2f\u7a4d\u3092\u51fa\u3059\u300d\u5834\u9762\u3067\u5fdc\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<hr>\n<h2>\u540c\u3058\u65e5\u4ed8\u304c\u3042\u308b\u5834\u5408\u306fROWS\u3068\u4e26\u3073\u9806\u3092\u78ba\u8a8d<\/h2>\n<p>\u7d2f\u7a4d\u5408\u8a08\u304c\u610f\u56f3\u3068\u9055\u3046\u3068\u304d\u306f\u3001`ORDER BY`\u306e\u91cd\u8907\u5024\u304c\u539f\u56e0\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002PostgreSQL\u3067\u306f\u3001\u30a6\u30a3\u30f3\u30c9\u30a6\u306e`ORDER BY`\u3092\u6307\u5b9a\u3057\u3066\u30d5\u30ec\u30fc\u30e0\u3092\u7701\u7565\u3059\u308b\u3068\u3001\u65e2\u5b9a\u306e\u30d5\u30ec\u30fc\u30e0\u306f\u540c\u9806\u4f4d\u306e\u884c\uff08peer\uff09\u307e\u3067\u542b\u307f\u307e\u3059\u3002<\/p>\n<p>\uff08PostgreSQL\u3067\u306e\u65e2\u5b9a\u30d5\u30ec\u30fc\u30e0\u3068\u540c\u9806\u4f4d\u306e\u6271\u3044\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/www.postgresql.org\/docs\/current\/functions-window.html\">PostgreSQL\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u95a2\u6570\u306e\u8aac\u660e<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>\u4f8b\u3048\u3070`ORDER BY sold_on`\u3060\u3051\u3060\u3068\u30012026-01-05\u306e3\u884c\u306f\u540c\u3058\u65e5\u4ed8\u3067\u3059\u3002\u5148\u982d\u306e\u884c\u3067\u3082\u3001\u305d\u306e\u65e5\u4ed8\u306e\u58f2\u4e0a\u5408\u8a08390\u307e\u3067\u8a08\u7b97\u5bfe\u8c61\u306b\u306a\u308a\u5f97\u307e\u3059\u3002\u300c\u660e\u7d30\u3092\u4e0a\u304b\u30891\u884c\u305a\u3064\u8db3\u3059\u300d\u7d50\u679c\u304c\u5fc5\u8981\u306a\u3089\u3001`ROWS`\u3092\u660e\u793a\u3057\u3001`sale_id`\u306e\u3088\u3046\u306a\u4e00\u610f\u306e\u5217\u3082\u4e26\u3073\u9806\u306b\u52a0\u3048\u308b\u3068\u610f\u56f3\u3092\u660e\u78ba\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>SUM(amount) OVER (\r\n    ORDER BY sold_on, sale_id\r\n    ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW\r\n)<\/code><\/pre>\n<p>`ROWS`\u3060\u3051\u6307\u5b9a\u3057\u3066\u3082\u3001\u540c\u3058\u30ad\u30fc\u306e\u5185\u90e8\u9806\u304c\u6c7a\u307e\u3063\u3066\u3044\u306a\u3051\u308c\u3070\u7d50\u679c\u306e\u5bfe\u5fdc\u95a2\u4fc2\u304c\u5b89\u5b9a\u3057\u307e\u305b\u3093\u3002\u4e26\u3073\u9806\u3068\u30d5\u30ec\u30fc\u30e0\u6307\u5b9a\u306f\u30bb\u30c3\u30c8\u3067\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u65e5\u5225\u306e\u5408\u8a08\u3092\u4f5c\u3063\u3066\u304b\u3089\u7d2f\u7a4d\u3059\u308b\u5834\u5408<\/h2>\n<p>\u300c\u660e\u7d301\u4ef6\u305a\u3064\u300d\u3067\u306f\u306a\u304f\u300c\u65e5\u4ed8\u3054\u3068\u300d\u306e\u7d2f\u7a4d\u304c\u6b32\u3057\u3044\u3068\u304d\u306f\u3001\u5148\u306b\u65e5\u5225\u5408\u8a08\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre><code>WITH daily_sales AS (\r\n    SELECT\r\n        sold_on,\r\n        SUM(amount) AS daily_amount\r\n    FROM sales\r\n    GROUP BY sold_on\r\n)\r\nSELECT\r\n    sold_on,\r\n    daily_amount,\r\n    SUM(daily_amount) OVER (\r\n        ORDER BY sold_on\r\n        ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW\r\n    ) AS running_total\r\nFROM daily_sales\r\nORDER BY sold_on;<\/code><\/pre>\n<p>\u3053\u306e\u4f8b\u3067\u306f1\u67085\u65e5\u306e\u65e5\u5225\u5408\u8a08\u304c390\u30011\u67086\u65e5\u304c210\u306a\u306e\u3067\u3001\u65e5\u5225\u7d2f\u7a4d\u306f390\u3001600\u3068\u306a\u308a\u307e\u3059\u3002`GROUP BY`\u3068\u30a6\u30a3\u30f3\u30c9\u30a6\u95a2\u6570\u306f\u7af6\u5408\u3059\u308b\u3082\u306e\u3067\u306f\u306a\u304f\u3001<strong>\u96c6\u8a08\u3059\u308b\u5358\u4f4d\u306b\u3088\u3063\u3066\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046<\/strong>\u3082\u306e\u3067\u3059\u3002<\/p>\n<h2>\u7d2f\u7a4d\u304c\u5408\u308f\u306a\u3044\u3068\u304d\u306e\u78ba\u8a8d\u30dd\u30a4\u30f3\u30c8<\/h2>\n<ul>\n<li><strong>\u30c1\u30fc\u30e0\u3084\u62c5\u5f53\u8005\u3092\u307e\u305f\u3044\u3067\u5408\u8a08\u3055\u308c\u308b<\/strong>\uff1a`PARTITION BY`\u304c\u5fc5\u8981\u304b\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li><strong>\u540c\u3058\u65e5\u4ed8\u306e\u884c\u304c\u307e\u3068\u3081\u3066\u52a0\u7b97\u3055\u308c\u308b<\/strong>\uff1a\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u30d5\u30ec\u30fc\u30e0\u3068`ROWS`\u6307\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li><strong>\u660e\u7d30\u306e\u8868\u793a\u9806\u3068\u7d2f\u7a4d\u9806\u304c\u5408\u308f\u306a\u3044<\/strong>\uff1a`OVER`\u5185\u3068\u6700\u7d42\u7d50\u679c\u306e`ORDER BY`\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li><strong>\u671f\u9593\u3092\u7d5e\u308b\u3068\u521d\u671f\u5024\u304c\u5909\u308f\u308b<\/strong>\uff1a`WHERE`\u3067\u9664\u5916\u3055\u308c\u305f\u884c\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u8a08\u7b97\u306e\u5bfe\u8c61\u5916\u3002\u5168\u671f\u9593\u306e\u7d2f\u7a4d\u3092\u8a08\u7b97\u3057\u3066\u304b\u3089\u671f\u9593\u3092\u5207\u308a\u51fa\u3059\u306a\u3089\u3001\u30b5\u30d6\u30af\u30a8\u30ea\u3067\u8a08\u7b97\u3068\u8868\u793a\u306e\u30d5\u30a3\u30eb\u30bf\u3092\u5206\u3051\u308b\u3002<\/li>\n<li><strong>\u65e5\u5225\u30fb\u6708\u5225\u306e1\u884c\u304c\u6b32\u3057\u3044<\/strong>\uff1a\u5148\u306b`GROUP BY`\u3067\u305d\u306e\u5358\u4f4d\u3078\u96c6\u7d04\u3057\u3066\u304b\u3089\u7d2f\u7a4d\u3059\u308b\u3002<\/li>\n<\/ul>\n<p>\u5927\u304d\u306a\u30c6\u30fc\u30d6\u30eb\u3067\u306f\u3001\u5b9f\u884c\u8a08\u753b\u30fb\u30bd\u30fc\u30c8\u30fb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u52b9\u679c\u306f\u30c7\u30fc\u30bf\u91cf\u3084DBMS\u3067\u5909\u308f\u308a\u307e\u3059\u3002\u7279\u5b9a\u306e\u66f8\u304d\u65b9\u304c\u5e38\u306b\u9ad8\u901f\u3068\u306f\u6c7a\u3081\u3064\u3051\u305a\u3001\u5b9f\u30c7\u30fc\u30bf\u3068\u5b9f\u884c\u8a08\u753b\u3067\u5224\u65ad\u3057\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081\uff1a\u4f55\u30921\u884c\u3068\u3057\u3066\u8868\u793a\u3057\u305f\u3044\u304b\u304b\u3089\u6c7a\u3081\u308b<\/h2>\n<p>`SUM(&#8230;) OVER`\u3092\u4f7f\u3048\u3070\u3001\u660e\u7d30\u3092\u6b8b\u3057\u305f\u307e\u307e\u7d2f\u7a4d\u5408\u8a08\u3092\u8a08\u7b97\u3067\u304d\u307e\u3059\u3002`GROUP BY`\u306f\u96c6\u7d04\u5f8c\u306e1\u884c\u304c\u6b32\u3057\u3044\u3068\u304d\u3001`PARTITION BY`\u306f\u30c1\u30fc\u30e0\u306a\u3069\u3067\u8a08\u7b97\u3092\u533a\u5207\u308a\u305f\u3044\u3068\u304d\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u30b5\u30f3\u30d7\u30eb\u306e5\u884c\u3067`GROUP BY`\u3068\u306e\u7d50\u679c\u884c\u6570\u306e\u9055\u3044\u3092\u78ba\u8a8d\u3057\u3001\u540c\u3058\u65e5\u4ed8\u3092\u542b\u3080\u30c7\u30fc\u30bf\u3067`ROWS`\u306e\u6709\u7121\u3092\u6bd4\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u5b9f\u52d9\u306eSQL\u3078\u5fdc\u7528\u3059\u308b\u3068\u304d\u306f\u3001\u4f55\u30921\u884c\u3068\u3059\u308b\u304b\u3001\u3069\u306e\u5217\u3067\u9806\u5e8f\u3092\u78ba\u5b9a\u3059\u308b\u304b\u3092\u5148\u306b\u6c7a\u3081\u308b\u3068\u8ff7\u3044\u306b\u304f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"featured_media":6505,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/6502"}],"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\/6505"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=6502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}