title: Minus values Oracle SQL
body: <p>I have the below Oracle working fine however I want to calculate <code>Sum(manhours)-Leavetaken</code></p>
  
  <p>I am unsure if this is because some of values of <code>Leavetaken</code> are null so it's pulling back null if I try it as above. But if even <code>leavetaken</code> is null, I want just the full value of <code>sum(manhours)</code></p>
  
  <p>Here's  my current query:</p>
  
  <pre><code>select lsc.work_date, location,site, sum(manhours), Leavetaken
  from location_site_capacity lsc
  left outer join (
      select work_date, sum(manhours) as Leavetaken from location_site_capacity
      where break is not null
      group by work_date) A on A.work_date = lsc.work_Date
  where lsc.work_date between '01/JUN/15' and '30/JUN/15'
  group by  lsc.work_date, location,site, Leavetaken
  order by lsc.work_Date,location
  </code></pre>