James Smith wrote:
>
> FROM table1 x JOIN table2 y ON x.ID = y.ID

> FROM  table1 x, table2 y
> WHERE x.ID = y.ID

> This has the added benefit of taking the place of the 'WHERE 0=0' line we
> recently discussed.  What are the benefits of one form of inner join over
> the other or is it just today's SQL fashion trend?

IMHO the easiest way to write anything but the simplest queries is:
- write the FROM to include all data and relations
- add the WHERE to filter records
- add the SELECT to indicate the exact fields you want
- add, sorting and grouping as needed

Using the JOIN keyword in the FROM helps by keeping the logic to
relate tables to eachother separate from the logic to filter the
desired rows. But in the end it is a matter of style and preference.

> Secondly I notice more and more use of the cfqueryparam tag, what is wrong
> with simply using
>
> WHERE x.ID  = #form.id#
>   AND y.var = '#url.string#'
>
> type formatting?

STA.

Jochem
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to