title: SQL -- Dividing two results
body: <p>I have two querys below, both of which are feeding from the same &quot;player&quot; table. I want to divide query 1 by query 2 to get a relevant percentage. Im relatively new to more detailed SQL queries, as well as posting on forums...but please let me know if you have any suggestions on how to combine this to get the relevant percentage result.</p>
  <h3>1</h3>
  <pre><code>Select
    sysdate,sum(Count(init_dtime))
  From Player p
  Where
    Trunc(Init_Dtime) &gt; Trunc(Sysdate) - 7 
    And Trunc(Create_Dtime) &gt;= To_Date('2012-mar-01','yyyy-mon-dd')
    and trunc(create_dtime) &lt; to_date('2015-sep-9','yyyy-mon-dd')
  Group By Trunc(Init_Dtime)
  Order By Trunc(Init_Dtime) Asc
  </code></pre>
  <h3>2</h3>
  <pre><code>Select
    Sum(Count(Create_Dtime))
  From Player P
  where 
    Trunc(Create_Dtime) &gt;= To_Date('2012-mar-01','yyyy-mon-dd')
    And Trunc(Create_Dtime) &lt; To_Date('2015-sep-9','yyyy-mon-dd')
  Group By Trunc(create_Dtime)
  Order By Trunc(create_Dtime) Asc
  </code></pre>