Disable parentheses in sql queries

is there a way to tell ms access (2003) not to enclose in parentheses. or at least understand them without (every other database)

I need something like:

    SELECT *
      FROM a
INNER JOIN b
        ON a.a = b.a
INNER JOIN c
        ON b.c = c.c

      

but access tells me the request is wrong. ITS NOT, and it drives me crazy ...

it also puts all connections on one line - impossible to read

early.

ps. I have already activated ANSI 92 compatibility / support in settings

+2


source to share


3 answers


Unfortunately no. Access 2003 is just silly about SQL. It's “wrong” that Access can only parse one JOIN, which leaves you pissed off (but also still correct):



SELECT *
FROM a
INNER JOIN (b INNER JOIN c ON b.c = c.c)
    ON a.a = b.a

      

+2


source


See Access Help About ANSI SQL Query Mode (MDB) .

This mode closely matches the ANSI-92 Level 1 Specification, but is not compliant with ANSI-92 Level 1.



For "ANSI-92" read "ANSI / ISO SQL-92" (and for "closely matches" read "vaguely resembles").

Bottom line: you must include parentheses. Note that the Access Database Engine Optimizer can reorder the tables as it sees fit.

+2


source


I just tried the SQL Server Compantible (ANSI 92) syntax and checked this database.

I try to tune all my tables and joins in the graphical query builder and then tweak in the SQL editor while working with all the parentheses. The use of square brackets also confuses me. I am fortunate that most of the applications in my firm are ported from Access to SQL Server.

0


source







All Articles