{"image_url":null,"published":"2021-10-30 00:00:00","author_name":"dk521123","blog_url":"https://dk521123.hatenablog.com/","type":"rich","version":"1.0","blog_title":"\u30d7\u30ed\u30b0\u30e9\u30e0 \u306e\u8d85\u500b\u4eba\u7684\u306a\u30e1\u30e2","url":"https://dk521123.hatenablog.com/entry/2021/10/30/000000","categories":["SQL"],"author_url":"https://blog.hatena.ne.jp/dk521123/","width":"100%","title":"\u3010SQL\u3011\u65e5\u4ed8\u30fb\u65e5\u6642\u306b\u95a2\u3059\u308b\u64cd\u4f5c\u3059\u308b\u95a2\u6570","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdk521123.hatenablog.com%2Fentry%2F2021%2F10%2F30%2F000000\" title=\"\u3010SQL\u3011\u65e5\u4ed8\u30fb\u65e5\u6642\u306b\u95a2\u3059\u308b\u64cd\u4f5c\u3059\u308b\u95a2\u6570 - \u30d7\u30ed\u30b0\u30e9\u30e0 \u306e\u8d85\u500b\u4eba\u7684\u306a\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","description":"\u25a0 \u306f\u3058\u3081\u306b Snowflake \u306e \u30bb\u30df\u30ca\u30fc\u3092\u53d7\u3051\u3066\u3044\u3066\u3001 date_trunc() \u304c\u3067\u3066\u304d\u3066\u3001\u4eca\u5f8c\u3082\u4f7f\u3048\u305d\u3046\u3060\u3063\u305f\u306e\u3067 SQL\u306e\u65e5\u4ed8\u30fb\u65e5\u6642\u306b\u95a2\u3059\u308b\u64cd\u4f5c\u3059\u308b\u95a2\u6570\u3092 \u5f90\u3005\u306b\u30e1\u30e2\u3063\u3066\u3044\u304f\u3002 \u76ee\u6b21 \u3010\uff11\u3011DATE_TRUNC\u95a2\u6570 \u3010\uff11\u3011DATE_TRUNC\u95a2\u6570 * \u6307\u5b9a\u3057\u305f\u5358\u4f4d\uff08\u300chour\u300d\u300cmonth\u300d\u306a\u3069\uff09\u3067\u5207\u308a\u6368\u3066\u308b => GROUP BY\u53e5\u306a\u3069\u3092\u5229\u7528\u3057\u3066\u3001\u65e5/\u6708/\u6642\u9593\u3054\u3068\u306e\u96c6\u8a08\u306b\u5f79\u7acb\u3061\u305d\u3046 \u69cb\u6587 date_trunc(text, timestamp) https://www.postgresql.jp/document/7.2/user/functions-datetime.html \u30b5\u2026","height":"190"}