title: Filtering Mutual Relation in SQL
body: <p>I have two tables, People and Relation. There schemas are as follows:</p>
  <pre><code>People(id int primary key, name varchar(10))
  Relation(id1 references People(id), id2 references People(id), r varchar(10))
  </code></pre>
  <p>Here, <code>r</code> in relation can represent <code>'partner'</code> or <code>'rival'</code>.</p>
  <p>My task is to filter the mutual relationship from schemas into a separate table  where they consider each other as partners or rivals. Here, mutual relationship is where both people consider each other as <code>'partner'</code> or <code>'rival'</code>. For example, <code>1, 2, friend</code> and <code>2, 1, friend</code> is a mutual relationship pair <code>1, 2</code>.</p>
  <p>I attempted to join the table, but unable to filter out the mutual relationship pair. Could anyone point me to the right direction?</p>