-1

I keep getting the following error when i try execute the code, please help :)

Thank you

SELECT 
    STUDENTID, FIRSTNAME, SURNAME, HOMEWORKID
FROM 
    TBLSTUDENT
JOIN 
    TBLHOMEWORK.HOMEWORKID, TBLHOMEWORK.STUDENTID, TBLHOMEWORK.EVENTTYPE
WHERE 
    TBLHOMEWORK.EVENTTYPE = 'Meeting'
JOIN 
    TBLMEETING.HOMEWORKID, TBLMEETING.LOCATION
ORDER BY 
    HOMEWORKID;
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
S.K
  • 1
  • Sample data, desired results, the layout of the tables, and a description of what you want to do would all help. – Gordon Linoff Jul 20 '19 at 16:17
  • Possible duplicate of [Missing Keyword in JOIN syntax](https://stackoverflow.com/questions/16470802/missing-keyword-in-join-syntax) – vahdet Jul 20 '19 at 18:41

1 Answers1

3

Your query just makes no sense. A SQL query starts with SELECT. It then has one FROM clause that contains all references to tables. JOIN is an operator between two tables that requires an ON clause. There is only one WHERE, with all conditions for filtering.

I am imagining this is what you intend:

SELECT s.STUDENTID, s.FIRSTNAME, s.SURNAME, h.HOMEWORKID,
       m.LOCATION
FROM TBLSTUDENT s JOIN
     TBLHOMEWORK h
     ON s.STUDENTID = h.STUDENTID JOIN
     TBLMEETING m
     ON m.HOMEWORKID = h.HOMEWORKID 
WHERE h.EVENTTYPE = 'Meeting'
ORDER BY h.HOMEWORKID;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786