<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>g08m11</author_name>
  <author_url>https://blog.hatena.ne.jp/g08m11/</author_url>
  <blog_title>Web + Life Hack</blog_title>
  <blog_url>https://g08m11.hateblo.jp/</blog_url>
  <categories>
    <anon>rails</anon>
  </categories>
  <description>railsを使いながらmysqlのデータを取得する機会というのはwebサービスで必要で、 単一のテーブルや単純な条件であれば「.where()」を使い、 指定の条件であればモジュールに引数にオブジェクトを渡し、 「?」を使用してその値を利用したりするかと思います。 しかし、複数テーブルの利用や複雑なSQL(JOINなど)の場合、「.where()」だとパフォーマスが下がる場合は「.find_by_sql()」を利用します。 その「.find_by_sql()」でも「.where()」同様、「?」が利用できるようになりました。 例えば .where()の場合 /where(&quot;reserv.res…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fg08m11.hateblo.jp%2Fentry%2F2013%2F03%2F07%2F092729&quot; title=&quot;【rails】これは便利！「.find_by_sql()」でも「?」が使えてびびった話 - Web + Life Hack&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>2013-03-07 09:27:29</published>
  <title>【rails】これは便利！「.find_by_sql()」でも「?」が使えてびびった話</title>
  <type>rich</type>
  <url>https://g08m11.hateblo.jp/entry/2013/03/07/092729</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
