Subject | Re: [ib-support] search conditions in OUTER JOIN vs WHERE |
---|---|
Author | Marco Bommeljé |
Post date | 2002-11-14T11:09:52Z |
Hi Hellen, Arno and others,
Thanks for the explanations. You're a big help.
It seems that I still do not know the complete SQL-92 standards by
heart. (I did read Melton's book and worked thru the SQL Standard
Handbook by Cannan & Otten.)
So, to summarize:
SQL:
* the WHERE clause is related to the results of FROM clause
* conditions in the ON are directly related to the table references
IB/FB:
* changed parameters in ON: query is re-prepared
* changed parameters in WHERE: prepared query is unaffected
LEARNING EXPERIENCE:
* No more SQL-89 JOINs (ambiguous, inefficient when params change)
* Always use correlation names in JOINs to avoid ambiguous col refs
* Choose Firebird.
Cheers,
Marco
Thanks for the explanations. You're a big help.
It seems that I still do not know the complete SQL-92 standards by
heart. (I did read Melton's book and worked thru the SQL Standard
Handbook by Cannan & Otten.)
So, to summarize:
SQL:
* the WHERE clause is related to the results of FROM clause
* conditions in the ON are directly related to the table references
IB/FB:
* changed parameters in ON: query is re-prepared
* changed parameters in WHERE: prepared query is unaffected
LEARNING EXPERIENCE:
* No more SQL-89 JOINs (ambiguous, inefficient when params change)
* Always use correlation names in JOINs to avoid ambiguous col refs
* Choose Firebird.
Cheers,
Marco