> The issue is not number of words but clarity and readability.  Sometimes
> more words increase readability.  But not always.
>
>   MyListBox DOT
>     Items OPENSQUARE MyIndex CLOSESQUARE DOT
>     AddString OPENROUND 'ack' CLOSEROUND ENDSTMT
>
> might be an improvement, but not everything will end up quite so readable.
> :-)

I agree entirely. In the case of ansi join syntax, when laid out the way I
have I think it does improve clarity particularly for people less able to
think in SQLese. For someone like yourself it is probably hard to improve on
the syntax you are used to using.

> My issue with ansi join syntax isn't really the word JOIN, or even LEFT,
> RIGHT and INNER - more having to have the join clauses thrown into the
from
> statement.  IMO, it breaks up both the list of tables and the list of join
> clauses to have them there.  But the keyword JOIN can mislead.  If I write
> "from A join B on ... join C on ... join D on ...", there is an implied
> hierarchy, A to B to C to D.  But what if B, C and D are logically detail
> tables off A, and that is their only relation?  How do you write a
statement
> that doesn't mislead?
>
> ... <Snip examples>

Agreed - Ansi join syntax doesn't specify which tables are providing the
columns for the joins and arguably makes it more difficult to work this out
by obscuring the on/join conditions with extra keywords. However
interpreting the way the tables are being joined comes down to interpreting
"a.staff_id = b.manager_id" in either syntax so I don't think the difference
is major.

> It's up to you to generate the joins correctly - there is no "slot" to
> remind you to provide a one-to-one join between each table you add and the
> rest of the statement, but then you don't always have a join of exactly
one
> column between tables anyway.

Leaving it up to you to generate the joins correctly is great if you don't
want to specify the join but it must have caused many an error over the
years.

> Incidently, I just realised I don't know how to do a cross product between
> tables using ansi join syntax.  Somehow I don't think it's just "ON ".
> Anyone?
>
select *
  from a
 cross join b

(as you would expect no on clause involved).

David Brennan.
DB Solutions Ltd.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to