<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>a4dosanddos</author_name>
  <author_url>https://blog.hatena.ne.jp/a4dosanddos/</author_url>
  <blog_title>プログラム日記</blog_title>
  <blog_url>https://a4dosanddos.hatenablog.com/</blog_url>
  <categories>
    <anon>PostgreSQL</anon>
  </categories>
  <description>PostgreSQL で「対象のデータが存在しない場合のみINSERTする（既にデータが存在する場合にINSERTしない）」SQLのメモ。 BEGIN; INSERT INTO test.t1 (id, name) SELECT 1, 'aaa' WHERE NOT EXISTS (SELECT id FROM test.t1 WHERE id = 1); COMMIT; 上記のように NOT EXISTS を使えば簡単にできるようです。SQL は断片的な知識しかないせいでいつも簡単なことでも苦労します・・・勉強しないといけませんね。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa4dosanddos.hatenablog.com%2Fentry%2F2017%2F10%2F09%2F172447&quot; title=&quot;データの存在有無を確かめてINSERTする - プログラム日記&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>2017-10-09 17:24:47</published>
  <title>データの存在有無を確かめてINSERTする</title>
  <type>rich</type>
  <url>https://a4dosanddos.hatenablog.com/entry/2017/10/09/172447</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
