<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>paranishian</author_name>
  <author_url>https://blog.hatena.ne.jp/paranishian/</author_url>
  <blog_title>paranitips</blog_title>
  <blog_url>https://paranishian.hateblo.jp/</blog_url>
  <categories>
    <anon>開発</anon>
  </categories>
  <description>CONCAT関数を使います。 例えばcolA, colBの２つのカラムでaaaを検索したい場合、 SELECT * FROM hoge_table where CONCAT(colA, colB) = &quot;aaa&quot; となります。 ただ、colA, colBのいずれかがNULLの場合、CONCATの結果もNULLになってしまうのでIFNULLで回避します。 SELECT * FROM hoge_table where CONCAT(IFNULL(colA,''), IFNULL(colB,'')) = &quot;aaa&quot; ちなみに Ransackで書く場合にも使えるので便利です。 ransacker :c…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fparanishian.hateblo.jp%2Fentry%2F2016%2F03%2F11%2F113020&quot; title=&quot;mysqlで同一単語を複数カラムにわたって検索する - paranitips&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>2016-03-11 11:30:20</published>
  <title>mysqlで同一単語を複数カラムにわたって検索する</title>
  <type>rich</type>
  <url>https://paranishian.hateblo.jp/entry/2016/03/11/113020</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
