title: find pairs of rows that have same column value
body: <p>Using SQL Server, I have a database table that models a collection of devices. Each device controls one or more regions, and each region can be either offline or online.</p>
  
  <p>I cannot have a situation where the same region is online on more than one device. </p>
  
  <p>table "FEP" schema is: </p>
  
  <pre><code>region_address [int]
  region         [int]
  online         [bit]
  </code></pre>
  
  <p>sample data:</p>
  
  <pre><code>region_address  region   online      
  3001100         100      0
  3002100         100      1
  3002200         200      0
  3002241         241      0
  3001123         123      0
  3003123         123      1
  3928999         999      1
  3921999         999      1
  </code></pre>
  
  <p>I need this query to list region 999 as being online on two (or more) listed devices. </p>
  
  <p>I use a simple <code>select * from fep order by region</code> to visually see if any two successive rows have online = 1, but this doesn't identify ONLY conflicting regions.</p>