title: Count of 2 columns by GROUP BY and catx giving different outputs
body: <p>I have to find distinct count of combination of 2 variables. I used the following 2 queries to find the count:</p>
  
  <pre><code>select count(*) from 
  (   select V1, V2 
      from table1
      group by 1,2
  ) a
  </code></pre>
  
  <p></p>
  
  <pre><code>select count(distinct catx('-', V1, V2)) 
  from table1
  </code></pre>
  
  <p>Logically, both the above queries should give the same count but I am getting different counts. Note that </p>
  
  <ul>
  <li>both V1 and V2 are integers </li>
  <li>Both variables can have null values, though there are no null values in my table</li>
  <li>There are no negative values </li>
  </ul>
  
  <p>Any idea why I might be getting different outputs? And which is the best way to find the count of distinct combinations of 2 or more columns? </p>
  
  <p>Thanks.</p>