<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>bookreadkun</author_name>
  <author_url>https://blog.hatena.ne.jp/bookreadkun/</author_url>
  <blog_title>おーみんブログ</blog_title>
  <blog_url>https://oooomincrypto.hatenadiary.jp/</blog_url>
  <categories>
    <anon>IT系その他</anon>
  </categories>
  <description>おはようございます。おーみんです。 今回は備忘録としてSQLでの水平展開についてまとめようと思います。 参考文献 『達人に学ぶSQL徹底指南書 第2版』 ミック 著 行持ちから列持ちへの水平展開 以下のような各県の性別の人口を記録しているPopTbl2テーブルがあります。 これを水平展開して というテーブルを作ることにしましょう。 その際のSQL文は以下になります。 ------------------ select sex, sum(population) as total, sum(case when pref_name = '徳島' then population else 0 end)…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Foooomincrypto.hatenadiary.jp%2Fentry%2Fabout-sql-lateral-spread&quot; title=&quot;【SQL 備忘録】行持ちから列持ちへの水平展開。 - おーみんブログ&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/b/bookreadkun/20190818/20190818210718.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-08-23 06:00:00</published>
  <title>【SQL 備忘録】行持ちから列持ちへの水平展開。</title>
  <type>rich</type>
  <url>https://oooomincrypto.hatenadiary.jp/entry/about-sql-lateral-spread</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
