title: MySQL Inner Join Query Syntax error
body: <p>I'm kind of a MySQL novice and can't figure out what is going wrong here. I have two tables. The left table is called Workouts. The relevant columns are <code>date</code> (type date) and <code>id</code> (type int). </p>
  
  <p>The right table is called <code>Workout_locations</code> (relevant fields: <code>workout_id type int, and location_id type int</code>). </p>
  
  <p>The join fields are <code>Workouts.id</code> and <code>Workout_locations.workout_id</code>.</p>
  
  <p>All I want to do is get a table of two columns: <code>date</code> (from Workouts), and <code>location_id</code> (from <code>Workout_locations</code>). I need to only pull records from the <code>Workouts</code> table based on a couple of fields (the sql statement should make this clear).</p>
  
  <p>Here is my sql syntax:</p>
  
  <pre><code>SELECT Workouts.date as date, Workout_locations.location_id as loc_id
  FROM Workouts 
  WHERE Workouts.pacegroup_id='9' AND (Workouts.date BETWEEN '2013-08-19' AND '2013-08-25') 
  INNER JOIN Workout_locations ON Workouts.id=Workout_locations.workout_id"
  </code></pre>
  
  <p>But I get this error:</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near 'INNER JOIN Workout_locations ON
    Workouts.id=Workout_locations.workout_id' at line 1</p>
  </blockquote>
  
  <p>I'm hoping that this is a very easy error to spot for someone who is experienced with this. Can anyone see it? Thanks!</p>