Are ordinary sql queries different from MS Access 2007 queries?
I have this simple query but it is not working in MS Access query (SQL View). What is wrong with this?
SELECT StudentSubject.*, Subject.*,Professor.*, Student.*, Church.*
FROM
(
SELECT StudentSubject.*, Subject.*,Professor.* , Student.*
FROM
(
SELECT StudentSubject.*, Subject.*,Professor.*
FROM
StudentSubject
LEFT JOIN Subject ON StudentSubject.SubjectID=Subject.SubjectID
INNER JOIN Professor ON Subject.ProfessorID=Professor.ProfessorID
)
INNER JOIN Student ON StudentSubject.StudentID=Student.StudentID
)
LEFT JOIN Church ON Student.ChurchID=Church.ChurchID;
I believe this would work if I was using MySQL/MSSQL(If I use alias and do it directly – this is the ouput of ms access sql designer)
I get syntax error on join operation. But MS Access doesn’t point out which join.
By “ordinary SQL” you probably mean entry level SQL-92 Standard SQL (whether you know it or not!)
As a whole, Access (ACE, Jet, whatever) is not compliant with SQL-92.
Specifically, Access’s
JOINsyntax is not compliant with SQL-92.In SQL-92, one or more
JOINclauses can be enclosed together within parentheses to show precedence; where no parentheses are used allJOINclauses will have the same precedence.In Access, each
JOINclause must be enclosed on its own within parentheses, however allJOINclauses will have the same precedence.In other words, Access chokes on the Standard syntax and its own syntax is less expressive than the Standard’s 🙁