<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nainaistar</author_name>
  <author_url>https://blog.hatena.ne.jp/nainaistar/</author_url>
  <blog_title>きり丸の技術日記</blog_title>
  <blog_url>https://nainaistar.hatenablog.com/</blog_url>
  <categories>
    <anon>SQL</anon>
    <anon>技術</anon>
  </categories>
  <description>1組の乱太郎、2組のきり丸、3組のしんべヱの情報が欲しい、といった組と名前の両方をキーにした検索をしたい時があります。 この記事では、単純にANDで結合できず、複数の条件を組み合わせた複合でのキーを検索条件として実行する方法を記載します。 環境 MySQL PostgreSQL 全DBでは確認していないので、ローカルDBでの動作確認をお願いします。 対応 次のどちらかで対応できます。 -- シンプル (?, ?) IN ((?, ?), (?, ?)) -- AND と ORを組み合わせる ((? AND ?) OR (? AND ?)) 具体的には次のSQLとなります。 WHERE (組, …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnainaistar.hatenablog.com%2Fentry%2Fsql-composite-condition&quot; title=&quot;SQLで複合したキーの検索条件でIN句検索する（複合、複数の組み合わせで条件検索） - きり丸の技術日記&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/n/nainaistar/20221024/20221024201837.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-11-14 12:00:00</published>
  <title>SQLで複合したキーの検索条件でIN句検索する（複合、複数の組み合わせで条件検索）</title>
  <type>rich</type>
  <url>https://nainaistar.hatenablog.com/entry/sql-composite-condition</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
