MySQL Inner Join Query-Syntaxfehler

Ich bin eine Art MySQL-Neuling und kann nicht herausfinden, was hier falsch läuft. Ich habe zwei Tische. Die linke Tabelle heißt Workouts. Die relevanten Spalten sinddate (Datum eingeben) undid (Typ int).

Der richtige Tisch heißtWorkout_locations (relevante Felder:workout_id type int, and location_id type int).

Die Verknüpfungsfelder sindWorkouts.id undWorkout_locations.workout_id.

Ich möchte nur eine Tabelle mit zwei Spalten abrufen:date (von Workouts) undlocation_id (vonWorkout_locations). Ich muss nur noch Platten aus dem ziehenWorkouts Tabelle basierend auf ein paar Feldern (die SQL-Anweisung sollte dies klar machen).

Hier ist meine SQL-Syntax:

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"

Aber ich bekomme diesen Fehler:

Sie haben einen Fehler in Ihrer SQL-Syntax. In dem Handbuch, das Ihrer MySQL-Serverversion entspricht, finden Sie in Zeile 1 die richtige Syntax für INNER JOIN Workout_locations ON Workouts.id = Workout_locations.workout_id

Ich hoffe, dass dies ein sehr einfacher Fehler für jemanden ist, der damit Erfahrung hat. Kann es jemand sehen? Vielen Dank!

Antworten auf die Frage(1)

Ihre Antwort auf die Frage