<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>AJYA</author_name>
  <author_url>https://blog.hatena.ne.jp/AJYA/</author_url>
  <blog_title>ソフトウェア開発者の日常</blog_title>
  <blog_url>https://ajya.hatenablog.jp/</blog_url>
  <categories>
    <anon>SQL</anon>
  </categories>
  <description>同じテーブルに値が2レコードとして保存されていて、クエリで1レコードとして取得する方法をすぐ忘れてしまうのでメモです。具体的なクエリは以下のとおりです。 SELECT table1.id AS table1_id, tmp.tmp_id FROM table1 LEFT OUTER JOIN ( SELECT id AS tmp_id, column2 AS tmp_column2, column4 AS tmp_column4 FROM table1 WHERE table1.column1 = 1) AS tmp ON table1.column2 = tmp.tmp_column2 WH…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fajya.hatenablog.jp%2Fentry%2F2017%2F01%2F23%2F063000&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/A/AJYA/20170123/20170123061828.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-01-23 06:30:00</published>
  <title>SQL:同じテーブルに格納されている値をサブクエリ(副問合せ)で結合して取得する</title>
  <type>rich</type>
  <url>https://ajya.hatenablog.jp/entry/2017/01/23/063000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
