text: Q:
  
  Get difference of sums in single query
  
  I have result from different request as an example.
  1st req:
  SELECT SUM(PRODUCT_QTY) FROM TABLEBLA
  WHERE STATE='DONE' and  location_dest_id in (12,18) and location_id=5
  
  gives:
  sum(product_qty)
  ----------------
  1200
  
  2nd req:
  SELECT SUM(PRODUCT_QTY) FROM TABLEBLA
  WHERE STATE='CANCEL' and location_id (12,18) and location_dest_id=5
  
  gives:
  sum(product_qty)
  ----------------
  900
  
  I want to get the result as 1200-900 = 300
  
  A:
  
  SELECT SUM(CASE WHEN STATE = 'DONE'  THEN PRODUCT_QTY ELSE 0 END) - 
  SUM(CASE WHEN STATE = 'CANCEL' THEN PRODUCT_QTY ELSE 0 END) 
   FROM TABLEBLA WHERE location_id IN (12,18) AND location_dest_id=5
  
  