Subject Re: [firebird-support] Join order
Author Helen Borrie
At 09:24 AM 28/08/2003 +0200, you wrote:
>In wich order are joins made:
>
>SELECT * FROM table1 t1 LEFT JOIN t2 ON (t1.key1=t2.key2) LEFT JOIN t3
>ON (t1.key2=t3.key1)
>
>t1 and t2 are joined first, and then t3 are joined by the result of
>t1+t2, right?
>
>SELECT * FROM table1 t1 INNER JOIN t2 ON (t1.key1=t2.key2) LEFT JOIN t3
>ON (t1.key2=t3.key1)
>
>Same order as the first statement, right?

The order is the same, but the results are different.


>Next question. Will there be support for the USING keyword in joins?

(looks into crystal ball...) - UNLIKELY.

1) Firebird doesn't support the SQL equijoin and never did, AFAIR. So
there is no use for USING in that context.
2) Firebird already uses the keyword USING (from Fb 1.5 onward) to specify
an explicit name and sort order for an integrity index, as in

ALTER TABLE ATEST
ADD CONSTRAINT PK_ATEST PRIMARY KEY(ID)
USING DESC INDEX IDX_PK_ATEST;

Point 2), per se, doesn't preclude the use of the same keyword in another
context - in fact, it's already used in ESQL for something entirely different.

But 1) is pretty unlikely to happen--superfluous, retrograde--considering
the amount of effort that has gone into eliminating ambiguity in joins.

heLen