title: Operating with oracle queries (multiply, divide, etc)
body: <p>I have these this query (oracle), I need to operate with the result and then apply the AVG, so it would be AVG((result*7)/40)</p>
  
  <p>I have tried wrapping it in parenthesis etc, but it won't work.</p>
  
  <pre><code>SELECT
  ((fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date))-(fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Submit_Date)))
  FROM CHG_INFRASTRUCTURE_CHANGE
  WHERE  fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date) 
  BETWEEN  '01-01-2015'  AND  '31-01-2015'
  AND 
  ((fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date))-(fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Submit_Date))) &lt; (SELECT 
  PERCENTILE_DISC(0.95) within group (order by(( fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date) )-( fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Submit_Date) )))
  FROM CHG_INFRASTRUCTURE_CHANGE WHERE  fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date)
  BETWEEN  '01-01-2015'  AND  '31-01-2015')
  </code></pre>
  
  <p>This is what I've tried</p>
  
  <pre><code>AVG((SELECT
  ((fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date))-(fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Submit_Date)))
  FROM CHG_INFRASTRUCTURE_CHANGE
  WHERE  fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date) 
  BETWEEN  '01-01-2015'  AND  '31-01-2015'
  AND 
  ((fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date))-(fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Submit_Date))) &lt; (SELECT 
  PERCENTILE_DISC(0.95) within group (order by(( fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date) )-( fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Submit_Date) )))
  FROM CHG_INFRASTRUCTURE_CHANGE WHERE  fn_adjusted_date(CHG_INFRASTRUCTURE_CHANGE.Completed_Date)
  BETWEEN  '01-01-2015'  AND  '31-01-2015'))*7)/40)
  </code></pre>
  
  <p>And I'm getting a SQLSyntaxErrorException ORA-00900</p>