title: Oracle How to simplify a select count(*) from (subquery)?
body: <p>I was asked to try to simplify a <code>count()</code> query but I do not know where to begin, the query is something like this: </p>
  
  <pre><code>SELECT COUNT( 1 )
  FROM (
          SELECT DISTINCT a.col,b.colx,c.coly
          FROM  a
              JOIN b on a.id = b.id
              JOIN c on b.id = c.id
          WHERE a.xyz = 'something'
          AND   b.hijk = 'something else'
          AND c.id IN (
                  SELECT cid
                  FROM cwa
                  WHERE csid = 22921
              )
          ORDER BY
              e.create_timestamp DESC
      );
  </code></pre>
  
  <p>I was told that the <code>SELECT COUNT(1) FROM (subquery)</code>  can be simplified, how can this be done ?</p>
  
  <p>I've tried a couple of things but the result is different to the query above.</p>