title: Counting the rows of multiple distinct columns
body: <p>I'm trying to count the number of rows that have distinct values in both of the columns "a" and "b" in my Sybase ISQL 9 database.</p>
  
  <p>What I means is, the following dataset will produce the answer "4":</p>
  
  <p><PRE>a b</p>
  
  <p>1 9
  2 9
  3 8
  3 7
  2 9
  3 7</PRE></p>
  
  <p>Something like the following syntax would be nice:</p>
  
  <pre><code>SELECT COUNT(DISTINCT a, b) FROM MyTable
  </code></pre>
  
  <p>But this doesn't work.  </p>
  
  <p>I do have a solution:</p>
  
  <pre><code>SELECT COUNT(*) FROM
    (SELECT a, b 
       FROM MyTable 
      WHERE c = 'foo'
      GROUP BY a, b) SubTable
  </code></pre>
  
  <p>But I was wondering if there is a neater way of constructing this query?</p>