A
A
AntonSol2018-04-23 09:02:30
SQL
AntonSol, 2018-04-23 09:02:30

Syntax error in FROM clause, what could be the reason?

When querying in Access 2016, I see a "Syntax error in FROM clause" message. Here is the query:
SELECT Table1.indexObject, Table1.ObjectNames, table2.measureCommFromTab, table3.izmerenije, max(table3.datetimeMess)
FROM Table1, table2, table3
ON (table2.keyID = table3.measureComm_id) and (Table1.keyID = table3 .indexObjectsTab_id)
WHERE table2.keyID>0 And indexObject In (55296, 55226)
GROUP BY table2.measureCommFromTab, Table1.indexObject
ORDER BY Table1.indexObject
What could be wrong? There are nuances when using Access? The matter is that the same request, in SQLite normally works...
Perhaps it is necessary to register Join?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Ananiev, 2018-04-23
@AntonSol

https://support.office.com/en-us/article/%D0%9E%D0...

V
Vlad_fox, 2018-04-23
@Vlad_fox

conditions listed after ON move to the block after WHERE , you get

SELECT Table1.indexObject, Table1.ObjectNames, table2.measureCommFromTab, table3.izmerenije, max(table3.datetimeMess)
FROM Table1, table2, table3
WHERE   (table2.keyID = table3.measureComm_id) and (Table1.keyID = table3.indexObjectsTab_id) and
table2.keyID>0 And indexObject In (55296, 55226)
GROUP BY table2.measureCommFromTab, Table1.indexObject
ORDER BY Table1.indexObject

if joining tables is specified not through JOIN , but by enumeration after FROM ,
then the ON clause is not applied, and the join conditions are listed along with the record filtering conditions in the WHERE clause.

K
Konstantin, 2018-04-23
@whiteworking

JOIN

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question