<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gothedistance</author_name>
  <author_url>https://blog.hatena.ne.jp/gothedistance/</author_url>
  <blog_title>Life is Really Short, Have Your Life!!</blog_title>
  <blog_url>https://aroundthedistance.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Sql</anon>
    <anon>Mysql</anon>
    <anon>Python</anon>
  </categories>
  <description>よくありますよね。履歴テーブルの最新を取りたいってやつ。履歴テーブルを顧客で集計して、その最新の履歴をゲットしたい。こういうやつだ。 select id, user_id, access_path, created from logs where year(created) = 2015 group by user_id order by id desc logsテーブルをuser_idで集計してまとめ上げ、その中の最新のレコードをorder byで習得する。が、このSQLは全く機能しません。MySQLだけなのか、他のDBMSでも機能しないのかはわかりませんが、手元のMySQL5.6系ではgr…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Faroundthedistance.hatenadiary.jp%2Fentry%2F2015%2F11%2F06%2F104553&quot; title=&quot;MySQLで履歴テーブルの最新を取りたい(Group ByとOrder By) - Life is Really Short, Have Your Life!!&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>2015-11-06 10:45:53</published>
  <title>MySQLで履歴テーブルの最新を取りたい(Group ByとOrder By)</title>
  <type>rich</type>
  <url>https://aroundthedistance.hatenadiary.jp/entry/2015/11/06/104553</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
