title: Comparing 2 Columns in same table
body: <p>I need to compare 2 columns in a table and give 3 things:</p>
  
  <ul>
  <li><strong>Count of rows checked</strong> (Total Rows that were checked)</li>
  <li><strong>Count of rows matching</strong> (Rows in which the 2 columns matched)</li>
  <li><strong>Count of rows different</strong> (Rows in which the 2 columns differed)</li>
  </ul>
  
  <p>I've been able to get just rows matching using a join on itself, but I'm unsure how to get the others all at once.  The importance of getting all of the information at the same time is because this is a very active table and the data changes with great frequency.</p>
  
  <p>I cannot post the table schema as there is a lot of data in it that is irrelevant to this issue.  The columns in question are both <code>int(11) unsigned NOT NULL DEFAULT '0'</code>.  For purposes of this, I'll call them <code>mask</code> and <code>mask_alt</code>.</p>