title: Hive dividing numbers from the same column
body: <p>I have table like this:</p>
  
  <pre><code>A |  null   |  15
  A |  X      |  30
  B |  null   |  10
  B |  Y      |  20
  </code></pre>
  
  <p>I would like to create a query which divides the numbers for A, same for B and so on so the output should be:</p>
  
  <pre><code>row1 | 2
  row2 | 2
  </code></pre>
  
  <p>What is the most efficient way to approach this in Hive considering I will need to make about 20 calculations like this in single query?</p>
  
  <p>EDIT: I always has two rows, one is a count for rows with parameter null, the other is count for non-null parameter. I need to get the rate. </p>