<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>chito_ng</author_name>
  <author_url>https://blog.hatena.ne.jp/chito_ng/</author_url>
  <blog_title>まずは蝋の翼から。</blog_title>
  <blog_url>https://knknkn.hatenablog.com/</blog_url>
  <categories>
    <anon>SQL</anon>
  </categories>
  <description>SQLにおいて、サブクエリは可読性下がるからWITH句を使えという話をしばしば聞く。 ただ、最近あえてサブクエリで記述している人がいたので WITH句とサブクエリで何が違うか について考えてみた。 同じ抽出内容だが片方はWITH句、片方はサブクエリで書いた以下のSQLをベースに話す。 WITH句 WITH sub1 AS ( SELECT aaa ,bbb FROM tbl1 ) ,sub2 AS ( SELECT xxx ,yyy FROM tbl2 ) SELECT sub1.aaa ,sub1.bbb ,sub2.xxx ,sub2.yyy FROM sub1 INNER JOIN su…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fknknkn.hatenablog.com%2Fentry%2F2018%2F03%2F21%2F031231&quot; title=&quot;WITH句かサブクエリか - まずは蝋の翼から。&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-03-21 03:12:31</published>
  <title>WITH句かサブクエリか</title>
  <type>rich</type>
  <url>https://knknkn.hatenablog.com/entry/2018/03/21/031231</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
