title: Compare rows in the same table using Oracle SQL based on unique combinations of columns
body: <p>I have seen a few questions on Stackoverflow that pertain to comparing rows but nothing quite like this question.  I have a table with columns similar to :</p>
  
  <pre><code> - Month       (Date (01-Jan-2013)
   - Country     (Varchar2)
   - SubCustomer (Varchar2)
   - FTE         (Number) Represents a value that is manually entered by employees each month
  </code></pre>
  
  <p>We may have some data such as this..</p>
  
  <pre><code> - 01-Jan-2013 USA Customer1 10
   - 01-Feb-2013 USA Customer1 15
   - 01-Mar-2013 USA Customer1 30
   - 01-Jan-2013 BRA Customer2 100
   - 01-Feb-2013 BRA Customer2 300
   - 01-Mar-2013 BRA Customer2 50
  </code></pre>
  
  <p>My goal is to compare the FTE that is entered and provide an Alert in a separate column like 'High Alert' or 'Low Alert' or 'Ok' if the FTE that is entered is +/- 2x the previous month for each Month + Country + SubCustomer.  I've been playing with different Case statements but I cannot seem to get the comparison to work from month to month.</p>
  
  <p>Using the data above, Customer 1 would produce an alert of "High Alert" from Feb to Mar and Customer 2 would produce a hgh alert of Jan to Feb and a Low Alert from Feb to Mar.</p>