title: How to substract values in order to have a positive result in an SQL select?
body: <p>I want to a query that substracts a number <code>B</code> to number <code>A</code>. The only condition is that the result has to be a positive number so if <code>A &gt; B</code> then the operation has to be <code>A - B</code> and if <code>B &gt; A</code> then the operation should be <code>B - A</code>.</p>
  
  <p>Is it possible to do this using only a <code>SELECT</code> clause or I should create a stored procedure?</p>
  
  <p>If so, how can I do this properly using a <code>SELECT</code> clause like the following?</p>
  
  <pre><code>select A - B from foo;
  </code></pre>