title: Oracle (or general sql) query to get 2 independent averages and counts from a simple table
body: <p>How can I do something like:</p>
  
  <pre><code>SELECT myKey, avg(x), avg(y), count(x), count(y)
  from t
  where x is not null
    and y is not null
  group by myKEY
  </code></pre>
  
  <p>On the table</p>
  
  <p>TABLE t</p>
  
  <pre><code>MyKey,X,Y
  K1,null,1
  K2,null,1
  K3,3,2
  K4,4,3
  K5,4,null
  K6,4,null
  </code></pre>
  
  <p>basically I would like to get the 2 averages and 2 counts in 1 query if possible (table is big).  This is  to run some analysis on some observations where the observations (X,Y) are independent.</p>
  
  <p>however the averages and counts are independent since I need to exclude the nulls from the column.</p>