<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sakaik</author_name>
  <author_url>https://blog.hatena.ne.jp/sakaik/</author_url>
  <blog_title>sakaikの日々雑感～(T)編</blog_title>
  <blog_url>https://sakaik.hateblo.jp/</blog_url>
  <categories>
    <anon>mysql</anon>
  </categories>
  <description>MySQLユーザ会のメーリングリストで、こんな話題がありました。 INSERT SELECT でのテーブル別名の使い方「歯抜けの数字を、連番になるようにレコードを追加する」という方法について、相関サブクエリを使用して解決したものですが、これ、相関サブクエリを使わずに今ならどう書くかな～と思って試してみました。 MLへの投稿の本題からはずれているので、自分の日記にて。 やりたいこととデータの準備 PKとして「歯抜け連番」がセットされているテーブルにて、抜けている数字のレコードを追加したい、というのがやりたいことです。 CREATE TABLE tbl2 (id INTEGER PRIMARY K…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsakaik.hateblo.jp%2Fentry%2F20220810%2Ffill_blank_numbers_by_sql&quot; title=&quot;歯抜け数字を埋めるSQL - sakaikの日々雑感～(T)編&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/s/sakaik/20220810/20220810142921.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-08-10 14:30:53</published>
  <title>歯抜け数字を埋めるSQL</title>
  <type>rich</type>
  <url>https://sakaik.hateblo.jp/entry/20220810/fill_blank_numbers_by_sql</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
