Subject | Re: Help me, please take a look at this select! |
---|---|
Author | sllimr7139 |
Post date | 2004-04-10T14:39:44Z |
So what's wrong with doing where clause joins? (eg. a.pkid=b.pkid)
Does the FB engine work more efficiently with the JOIN statement?
I've never had any real trouble with doing the where clause links so
can someone explain why I would want to switch to using the join
statement?
An how do you know whether or not your supposed to use the [LEFT]
operator?
Ryan.
--- In firebird-support@yahoogroups.com, Lucas Franzen <luc@r...>
wrote:
<snip>
Does the FB engine work more efficiently with the JOIN statement?
I've never had any real trouble with doing the where clause links so
can someone explain why I would want to switch to using the join
statement?
An how do you know whether or not your supposed to use the [LEFT]
operator?
Ryan.
--- In firebird-support@yahoogroups.com, Lucas Franzen <luc@r...>
wrote:
<snip>
> You shouldn't do joins in the where clause but replace them with
> explicite joins.
>
> select
> b.lworefid, a.COMPANYNAME, a.CONTACT,
> a.ADDRESS, a.CITYPROVINCE, a.POSTALCODE,
> a.PHONE, a.FAX, a.CELL,
> a.EMAIL, a.memberid
> from
> industrylwo b
> [LEFT] JOIN industrylwoexpressions a ON b.lwoid = a.lwoid
> WHERE
> B.lwoactive in (0, 1)
> /* or: B.lwoactive = 0 OR
> B.lwoactive = 1
> - but IN should be ressolved to the same */
> ORDER BY
> b.lwoid, a.companyname
>
> have a look at the plan after preparing the query.
> If this doesn't help post the DDL and execution you're getting.