title: MySQL Weekday/Weekend count - Part II
body: <p>I have posted about this before, which helped to give me the following SQL:</p>
  
  <pre><code> SELECT fname, MONTH( eventDate ) , IF( WEEKDAY( eventDate ) &lt;5, 'weekday', 'weekend' ) AS
   DAY , COUNT( * )
   FROM eventcal AS e
   LEFT JOIN users AS u ON e.primary = u.username
   GROUP BY fname, MONTH( eventDate ) , IF( WEEKDAY( eventDate ) &lt;5, 'weekday', 'weekend' ) ;
  </code></pre>
  
  <p>And that gives me the following results:</p>
  
  <pre><code> fname  MONTH( eventDate )  DAY     COUNT( * )
   Kevin  7                   weekday     3
   Kevin  7                   weekend     1
   Missy  7                   weekday     3
   Missy  7                   weekend     1
  </code></pre>
  
  <p>I'm having some trouble trying to achieve the following format:</p>
  
  <pre><code> fname  MONTH( eventDate )  Weekday COUNT     WEEKEND COUNT
   Kevin   7                   3                  1
   Missy     7                   3                  1
  </code></pre>
  
  <p>Can anyone offer some help? I would greatly appreciate it...</p>
  
  <p>You can see my schemas for 'user' and 'eventcal' at: <a href="https://stackoverflow.com/questions/1140596/mysql-php-algorithm-for-weekday-weekend-count-per-month">MySQL/PHP Algorithm for Weekday/Weekend count (per month)</a></p>