<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takeru-c</author_name>
  <author_url>https://blog.hatena.ne.jp/takeru-c/</author_url>
  <blog_title>パンプキンスパイスラテ</blog_title>
  <blog_url>https://pumpkin.hatenablog.jp/</blog_url>
  <categories>
    <anon>SQL</anon>
  </categories>
  <description>よく、「1,2,3,4,5」とリスト形式でデータを持ってるDBから、例えば「1」が含まれているものをSELECT文で読み込む、ってことがある。あまり考えずに、 SELECT * FROM テーブル名 WHERE カラム名 LIKE '%1%'; とやってしまうと、「2,3,11,12,13」などのデータも拾ってきてしまう。「11」も「'%1%'」に含まれてしまうから。だから今までこういう時は、データ自体に「|,2,3,11,12,13,|」とか「0,2,3,11,12,13,0」みたいに、前後に文字列を追加して、 SELECT * FROM テーブル名 WHERE カラム名 LIKE '%,1…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpumpkin.hatenablog.jp%2Fentry%2F20080127%2F1201430806&quot; title=&quot;リスト形式のデータから一致検索 - パンプキンスパイスラテ&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>2008-01-27 19:46:46</published>
  <title>リスト形式のデータから一致検索</title>
  <type>rich</type>
  <url>https://pumpkin.hatenablog.jp/entry/20080127/1201430806</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
