title: find the user entered value or sum the row values
body: <p>i need get the invoice number which has the particular value in price column, if not all the invoice numbers which have the sum value of that particular value in price column ..how to write an sql query for that </p>
  
  <p>i have attached the data of my table
  Data </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>invoice     price
  v1         1000      
  v2         200       
  v3         35        
  v4         500       
  v5         50        
  v6         300       
  v7         400</code></pre>
  </div>
  </div>
  </p>
  
  <p>expected output :<br>
  if(input 500) found =>then found v4</p>
  
  <p>else(sum of(v2,v6)</p>