title: Dividing two querys in PostgreSQL
body: <p>I am trying to divide two querys in PostgreSQL:</p>
  <p>My sample data is :</p>
  <pre><code>time                          coil_id    pushing_force  drawing_force
  
  &quot;2017-08-15 23:03:23.1&quot;          0        855.125          0   
  &quot;2017-08-15 23:03:23.11&quot;         0        822.12           0
  &quot;2017-08-15 23:03:23.12&quot;         0         0              771.572
  &quot;2017-08-15 23:03:23.13&quot;         0         0              772.572
  &quot;2017-08-15 23:03:23.14&quot;         1        899.92           0
  &quot;2017-08-15 23:03:23.15&quot;         1        821.12           0
  &quot;2017-08-15 23:03:23.16&quot;         1         0              742.15
  &quot;2017-08-15 23:03:23.17&quot;         2        892.1            0
  &quot;2017-08-15 23:03:23.18&quot;         2         0              775.528
  &quot;2017-08-15 23:03:23.19&quot;         2         0              771.572
  &quot;2017-08-15 23:03:23.2&quot;          3        955.52           0
  &quot;2017-08-15 23:03:23.21&quot;         3         0              768.866
  &quot;2017-08-15 23:03:23.22&quot;         3         0              765.866
  </code></pre>
  <p>My first query is:</p>
  <pre><code>SELECT avg(d1.pushing_force)*0.1
    FROM drawing d1, (
         SELECT coil_id, max(drawing_force) as mdrawing_force
           FROM drawing
          GROUP BY coil_id
         ) d2 
   WHERE d1.pushing_force &gt; d2.mdrawing_force
     AND d1.coil_id = d2.coil_id
  GROUP BY d1.coil_id
  ORDER BY d1.coil_id 
  </code></pre>
  <p>output:</p>
  <pre><code>96.0686237179488
  98.2271765407554
  98.3511043388427
  99.0244
  99.782412195122
  98.9033064593301
  </code></pre>
  <p>My second query is :</p>
  <pre><code>SELECT AVG(drawing_force)*0.1 from drawing group by coil_id order by coil_id
  </code></pre>
  <p>output :</p>
  <pre><code>67.4467013876606
  34.7058347285139
  45.304114594917
  36.9346255571282
  33.4687833398917
  24.9778648102293
  30.40511668208
  </code></pre>
  <p>I want to divide query1/query2 to see the output</p>