<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nminebb</author_name>
  <author_url>https://blog.hatena.ne.jp/nminebb/</author_url>
  <blog_title>Minerva Consulting AI &amp; データエンジニア</blog_title>
  <blog_url>https://www.mitech.work/</blog_url>
  <categories>
    <anon>日付関数</anon>
    <anon>SQL</anon>
  </categories>
  <description>日付時刻の６分刻み文字を作る 10分刻み、６分刻み といった時間枠の箱の中の イベント発生件数や 合計値を求めるために、 Where 発生時刻 &gt;= '2017/10/07 09:06:00' and 発生時刻 &lt; '2017/10/07 09:12:00' とやると 実行時間が恐ろしく長くなる これを回避するには、時刻を 刻み分単位に揃えて、 Group By で集計すると 実行を早くできる。 そのためには、イベント発生時刻 を 日付時刻タイプから ６分の剰余を引き算した文字列が必要になる。 日付のCONVERT SUBSTRING の 大売出しみたいなコードになりました。 /****** …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.mitech.work%2Fentry%2F2017%2F10%2F07%2F114829&quot; title=&quot;SQLで日付時刻の６分刻み文字を作る - Minerva Consulting AI &amp;amp; データエンジニア&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/n/nminebb/20171007/20171007114727.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-10-07 11:48:29</published>
  <title>SQLで日付時刻の６分刻み文字を作る</title>
  <type>rich</type>
  <url>https://www.mitech.work/entry/2017/10/07/114829</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
