title: mysql: Unknown column in field list
body: <p>I am creating a procedure where I'm supposed to look for the last date of an exam.<br>
  So I created a local variable for this because I will need this date in other things as well. However, when I do a simple SELECT of this local variable, I get the message: </p>
  
  <blockquote>
    <p>Unknown column 'last_exam' in 'field list'. </p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>DECLARE latest_exam date;
  
    SELECT DATE(MAX(ex_date))
      INTO latest_exam
      FROM vets
     WHERE an_id = p_animal_id
  GROUP BY an_id;
  
  SELECT latest_exam, and a bunch of other stuff. ;
  </code></pre>
  
  <p>In the select, do I need to include a FROM clause? I didn't think so because I figured latest_exam is within the procedure.</p>