title: I need to create a Query for comparing two columns in same table
body: <p>I need to create a SQL Query in which i have to compare the values in two columns of the same table in such a manner that the sum of values in one column is equal to a static value in another column. </p>
  
  <p>e.g, there are 4 columns </p>
  
  <pre><code>1.) Internal ID
  2.) Plan_id 
  3.) Numerator value
  4.) Denominator value.
  </code></pre>
  
  <p>So wherever Internal ID and Plan_id are unique, i need to add up the corresponding values for numerator column and then compare it with denominator column.</p>
  
  <p>for ex:</p>
  
  <pre><code>INTERNAL_ID      PLAN_ID         NUMERATOR       DENOMINATOR
  12345            10                30               50
  12345            10                20               50
  12345            20                10               50
  34566            10                10               10
  </code></pre>
  
  <p>Here i need to pick up the internal id 12345 as its sum of numerator value <code>(30+20) = 50 (denominator value)</code> for unique combination of plan_id and internal_id.</p>