Mr_Fulano
asked on
Parenthetical Hierarchy in the SELECT Statement
Hi, I'm using Access 2003. I'm not an SQL Guru, but rather I'm trying to learn as much as I can so that I can write good sound SQL statements. My question is regarding the parenthesis in the SELECT statement and how they are processed.
In a mathematical computation, there is a hierarchy as to which part of the equation is resolved first and which follows second and so on. -- Does that same hierarchy apply to the parenthesis; or better put, the statements within those parenthesis inside an SQL statement.
The parenthesis I'm referring to are like the ones below
SELECT *
FROM ((Table1
LEFT JOIN Table2 ON ...)
LEFT JOIN Table3 ON ...)
LEFT JOIN Table4 ON...
Does Table1 get evaluated first or which one if any gets evaluated first and why?
Thanks,
Fulano
In a mathematical computation, there is a hierarchy as to which part of the equation is resolved first and which follows second and so on. -- Does that same hierarchy apply to the parenthesis; or better put, the statements within those parenthesis inside an SQL statement.
The parenthesis I'm referring to are like the ones below
SELECT *
FROM ((Table1
LEFT JOIN Table2 ON ...)
LEFT JOIN Table3 ON ...)
LEFT JOIN Table4 ON...
Does Table1 get evaluated first or which one if any gets evaluated first and why?
Thanks,
Fulano
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Mr_Fulano,
Not sure how to answer your question, except to say that you have to arrange your parentheses such that
all operations are performed in the order in which you want them to occur.
Regards,
Patrick
Not sure how to answer your question, except to say that you have to arrange your parentheses such that
all operations are performed in the order in which you want them to occur.
Regards,
Patrick
ASKER
Thanks!
ASKER
Are there cases where some parenthesise MUST be grouped in a certain manner?
Thanks,
Fulano