title: Query including NULL and '' in SUM values even though it should be explicitly excluding them
body: <p>This query is taking parsed http requests and created counts of how many times certain types of page elements were viewed, then grouping by a number of criteria.  It should be explicitly excluding records from being counted in the <code>SUM</code> functions if the <code>controller_context_id</code> doesn't have some value other than <code>NULL</code> or <code>''</code>.  After running the query, however, I still get rows with an unpopulated <code>controller_context_id</code> that contains summed up numbers for whatever the <code>controller_type</code> was.  This shouldn't happen.  I would expect any rows that don't have a <code>controller_context_id</code> to have 0 in all the <code>num_page_views_*</code> columns.  </p>
  
  <p>Have I missed something fundamental in the logic of my query?</p>
  
  <pre><code>SELECT
              TRUNC(request_timestamp, 'month') AS request_timestamp,
              account_id,
              account_guid,
              cluster_id,
              shard_id,
              unique_id,
              context_id,
              controller_type,
              controller_context_id,
              concat_user_id,
              user_id,
              COUNT(account_id) AS num_page_views,
              SUM(CASE
                      WHEN controller_type LIKE 'pages%' AND
                           controller_context_id &lt;&gt; '' AND
                           controller_context_id IS NOT NULL
                      THEN 1
                      ELSE 0 END) AS num_page_views_pages,
              SUM(CASE
                      WHEN controller_type LIKE 'files%' AND
                           controller_context_id &lt;&gt; '' AND
                           controller_context_id IS NOT NULL
                      THEN 1
                      ELSE 0 END) AS num_page_views_files,
              SUM(CASE
                      WHEN controller_type LIKE 'modules%' AND
                           controller_context_id &lt;&gt; '' AND
                           controller_context_id IS NOT NULL
                      THEN 1
                      ELSE 0 END) AS num_page_views_modules,
              SUM(CASE
                      WHEN controller_type LIKE 'assignments%' AND
                           controller_context_id &lt;&gt; '' AND
                           controller_context_id IS NOT NULL
                      THEN 1
                      ELSE 0 END) AS num_page_views_assignments,
              SUM(CASE
                      WHEN controller_type LIKE 'quizzes%' AND
                           controller_context_id &lt;&gt; '' AND
                           controller_context_id IS NOT NULL
                      THEN 1
                      ELSE 0 END) AS num_page_views_quizzes,
              SUM(CASE
                      WHEN controller_type LIKE 'discussion_topics%' AND
                           controller_context_id &lt;&gt; '' AND
                           controller_context_id IS NOT NULL
                      THEN 1
                      ELSE 0 END) AS num_page_views_discussion_topics,
              SUM(CASE
                      WHEN controller_type LIKE 'outcome%' AND
                           controller_context_id &lt;&gt; '' AND
                           controller_context_id IS NOT NULL
                      THEN 1
                      ELSE 0 END) AS num_page_views_outcomes,
              COUNT(DISTINCT session_id) AS num_sessions
          FROM requests
          GROUP BY
            TRUNC(request_timestamp, 'month'),
            account_id,
            account_guid,
            cluster_id,
            shard_id,
            unique_id,
            context_id,
            context_id,
            controller_type,
            controller_context_id,
            concat_user_id,
            user_id
  </code></pre>