title: Comparing two SQL queries
body: <p>I've got a MySQL database of all NCAA basketball tournament results. I'm looking at the "haves" and "have nots" of college hoops, and looking for who drops in and out of the "haves" list by examining NCAA tournament bids over time.</p>
  
  <p>I've got a query that counts the number of NCAA appearances by each team for two sets of years. I want to compare the results for the two sets - seeing who dropped out and who dropped in from one year to the next.</p>
  
  <p>For example, which teams made 6 of 10 NCAA tournaments between 1985-94, which made 6 between 1986-95, and what are the differences in the two lists. Here's what I have:</p>
  
  <pre><code>Select t1.Team AS "1994 Teams",t2.Team AS "1995 Teams" 
  FROM
  (SELECT Count(DISTINCT TABLE_NAME.`Year`) AS 'Totals', TABLE_NAME.Team, TABLE_NAME.Current_Conference
  FROM TABLE_NAME
  WHERE TABLE_NAME.`Year` BETWEEN 1985 AND 1994
  GROUP BY TABLE_NAME.Team HAVING Totals &gt;= 6
  ORDER BY TABLE_NAME.Team) AS t1,
  
  (SELECT Count(DISTINCT TABLE_NAME.`Year`) AS 'Totals', TABLE_NAME.Team, TABLE_NAME.Current_Conference
  FROM TABLE_NAME
  WHERE TABLE_NAME.`Year` BETWEEN 1986 AND 1995
  GROUP BY TABLE_NAME.Team HAVING Totals &gt;= 6
  ORDER BY TABLE_NAME.Team) AS t2
  WHERE t1.Team = t2.Team
  </code></pre>
  
  <p>This returns (in this case) 32 records - all the teams that were in 6 of 10 NCAA tournaments in both 1985-94 and 1986-95. I'm trying to find the teams that are in one set and not the other. </p>