title: Compare two sets of an SQL "GROUP BY" result
body: <p>Here is my table:</p>
  
  <pre><code>ROUTES = the route ID
  STATIONS = the station ID
  STOPS? = if the train stops at this station then is equal to 1 otherwise 0
  
  -------------------------
  ROUTES STATIONS  STOPS?
  -------------------------
  R1    S1    1
  R1    S2    0
  R1    S3    1
  R1    S4    0
  R1    S5    1
  R2    S1    1
  R2    S2    1
  R2    S3    1
  R2    S4    0
  R2    S5    1
  R3    S1    1
  R3    S2    0
  R3    S4    1
  R3    S5    0
  R3    S6    1
  R3    S7    1
  R4    S1    1
  R4    S2    1
  R4    S3    0
  R4    S4    1
  R5    S2    1
  R5    S3    0
  R5    S4    1
  </code></pre>
  
  <p>What I am trying to do is to find which routes pass through the same stations but don't have the same stops.</p>
  
  <p>For example:
  We see that</p>
  
  <pre><code>Route R1 passes through stations S1-&gt;S2-&gt;S3-&gt;S4-&gt;S5 
  Route R2 passes through stations S1-&gt;S2-&gt;S3-&gt;S4-&gt;S5 
  </code></pre>
  
  <p>but they have different stops, so the result should be: </p>
  
  <pre><code>R1 
  R2
  </code></pre>
  
  <p>I thought to group first all the ROUTES and compare the STATIONS belonging to that group with all the others and check if they have at least one different stop.</p>