title: Calculate % improvement from pre and post test (MYSQL & PHP)
body: <p>Here is a link to this setup in SQLFiddle - <a href="http://sqlfiddle.com/#!2/b652d/1" rel="nofollow noreferrer">http://sqlfiddle.com/#!2/b652d/1</a></p>
  
  <p>I want to find all the students who did both a pre and a post test.  I then want to get an overall percent change from the pretest to the post test.  </p>
  
  <p>Here is my query which is not returning any result for the post test:</p>
  
  <pre><code> SELECT studid, TestDate, pre, post, ROUND( (
  ( post - pre ) / pre ) *100, 1 ) AS percentChange
  FROM bodpod
  WHERE ID2 =  'fall'
  AND studid !=  ''
  GROUP BY studid
  HAVING COUNT( DISTINCT ID1 ) &gt;1
  AND TestDate LIKE  '%2013%'
  </code></pre>
  
  <p>Here is sample data for one student:
  <img src="https://i.stack.imgur.com/RHhXM.gif" alt="Sample data for one student"></p>
  
  <p>How can I rewrite that query to get the desired results which is an overall percent change for all students that took the pre AND the post test in the fall of 2013?</p>