Steve

Interesting, Mainly it was a practical method of making the ANSI join syntax
'scannable'
Mostly (like everybody I suspect) I use inner (or natural if MS SQL
supported them!)
so I can see the field's selected and the list of tables they are from, I'd
prob
use a more heavily indented style if i wasn't using surrogate keys (ie more
than one join cond)

Neven

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

----- Original Message -----
From: Steve Peacocke <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Tuesday, January 30, 2001 6:17 PM
Subject: RE: [DUG]: Join SQL?


> On readable SQL
>
> >> 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
>
> An interesting style, I would have written it as...
>
> 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 m.staff_id = s.staff_id
>
> Shows the join statement relating to the table that does the join. I know,
> the SELECT and FROM should be on their own lines, but I've got out of the
> habit.
>
> Steve
>
> --------------------------------------------------------------------------
-
>     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"
>

---------------------------------------------------------------------------
    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