<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kikiki-kiki</author_name>
  <author_url>https://blog.hatena.ne.jp/kikiki-kiki/</author_url>
  <blog_title>かもメモ</blog_title>
  <blog_url>https://chaika.hatenablog.com/</blog_url>
  <categories>
    <anon>MySQL</anon>
  </categories>
  <description>MySQLで別々の条件(SELECT文)で取ってきたデータをそれぞれでソートして結合したい。 という事で、2回SQLを発行して取ってきたデータをマージしてしまえば実現できることなのですが、SQL1回で実現できないかと思い調べていて色々とハマったのでメモ。 テーブル テーブル名: test_table +----+------+------+ | id | num | text | +----+------+------+ | 1 | 10 | b | | 2 | 9 | c | | 3 | 8 | a | | 4 | 7 | e | | 5 | 6 | f | | 6 | 5 | d | | …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchaika.hatenablog.com%2Fentry%2F2017%2F12%2F22%2F100000&quot; title=&quot;MySQL UNION それぞれのSELECT文で取ってきたデータを、それぞれでソート(ORDER BY)してくっつけたい。 - かもメモ&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/k/kikiki-kiki/20171222/20171222090214.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-12-22 10:00:00</published>
  <title>MySQL UNION それぞれのSELECT文で取ってきたデータを、それぞれでソート(ORDER BY)してくっつけたい。</title>
  <type>rich</type>
  <url>https://chaika.hatenablog.com/entry/2017/12/22/100000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
