title: mysql, transpose/pivot row to column, variable selects
body: <p>Hello again  and thank you in advance for your help.</p>
  
  <p>I've checked a few prior questions and couldn't find this exact situation.</p>
  
  <p>I'm trying to transpose/pivot a row to column, but the results are based on a date function in the where clause, making my selects somewhat variable.</p>
  
  <pre>
  SELECT
  DATE_FORMAT(packet_details.installDate,'%m-%d-%Y') as Install_Date,
  Count(packet_details.installDate)
  FROM
  packet_details
  WHERE
   packet_details.installDate >= CURRENT_DATE - INTERVAL 7 DAY
   AND packet_details.installDate "*lessthan*" CURRENT_DATE + INTERVAL 7 DAY
  GROUP BY installDate
  *lessthan symbol wont show here on Stack & i don't know how to fix it
  </pre>
  
  <p>Not sure if that makes sense so I included a fiddle: <a href="http://sqlfiddle.com/#!2/5b235/3/0" rel="nofollow">http://sqlfiddle.com/#!2/5b235/3/0</a>
  So something like this:</p>
  
  <pre>INSTALL_DATE     COUNT
  1/24/2013         2
  1/25/2013         2
  1/26/2013         2
  1/27/2013         2
  1/28/2013         2
  1/29/2013         1
  2/3/2013          1
  2/4/2013          1
  2/5/2013          5
  2/6/2013          4</pre>
  
  <p>Turned into:</p>
  
  <pre>
  INSTALL_DATE    1/24/2013   1/25/2013   1/26/2013   1/27/2013   1/28/2013....   
  COUNT             2             2          2             2         2               1     
  </pre>