> > My Version
> >
> > SELECT
> > p.project_name, s.staff_name, m.staff_name
> > FROM
> > project p JOIN
> > staff s ON s.staff_id = s.staff_id JOIN
> > staff m ON on m.staff_id = s.staff_id
>
> Yeah, well that probably is more readable than what I had, but when an ON
> clause includes more than one column things become uglier. I don't like
the
> list of tables being broken up with join clauses in this way and needing
to
> use JOIN where a comma would do and oh well you get the picture...
>
> Hey, you still have that syntax error in there! :-)
>
I couldn't resist any more - how about:
select p.project_name, s.staff_name, m.staff_name
from project p
inner join staff s
on p.staff_id = s.staff_id
left join staff m
on p.manager_id = m.staff_id
Really needs to be in courier (or another proportional font) but you get the
idea. BTW this is the syntax we use for our SQL Server 7 stored procedures
which can be quite long.
I can just hear Carl saying "... yes but look at all those unnecessary
words...". However who are we (as Delphi programmers) to complain about
unnecessary words? How about Begin, End, Then etc. If it was all so
important to us then we should be using C so we could have curly braces,
single line for loops etc.
I felt similarly to Carl when I started using Ansi syntax (in my case
because Microsoft are threatening to do away with their very concise
proprietry outer join syntax in future versions of SQL Server). However I'm
happy enough now and I think in many cases Ansi is more readable,
particularly when someone less experienced with SQL needs to maintain it.
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"