As I am using mysql
4.0 right now (we’ve got a stupid problem with the 4.1 with the authentification protocol we can’t figure out) and the last
subquery (the one in the last LEFT JOIN) MUST be
removed … So I tried the following query: SELECT FROM lead L purchase P2 ) ON ( L.id = P2.lead_id ) exclusive IS NULL OR ( exclusive = 0 AND nb_purchases < 3 ) ) AND ( A.member_id <> 21101
OR A.member_id IS NULL ) AND ( P1.member_id <>
21101 OR P1.member_id IS NULL ) But it seems that the LEFT JOIN doesn’t work anymore and are replaced
by OUTER JOIN because the result of the query is (number of rows in Lead *
number of rows in PURCHASE * number of rows in …) And it seems that the condition L.id = P2.lead_id doesn’t work either … Could you tell me what
the problem is ? Thanks -----Original Message----- Maybe its better now. Anyway, what I think is that joining will perform better than using IN. Am I wrong?
|
- Re: [SQL] How to optimize this query ? Stephan Szabo
- Re: [SQL] How to optimize this query ? Franco Bruno Borghesi
- Re: [SQL] How to optimize this query ? Stephan Szabo
- Re: [SQL] How to optimize this query ? ProgHome
- Re: [SQL] How to optimize this quer... Stephan Szabo
- Re: [SQL] How to optimize this... krystoffff
- Re: [SQL] How to optimize this... ProgHome
- Re: [SQL] How to optimize this... Stephan Szabo
- Re: [SQL] How to optimize this query ? ProgHome
- Re: [SQL] How to optimize this quer... Stephan Szabo
- Re: [SQL] How to optimize this query ? ProgHome
- Re: [SQL] How to optimize this query ? krystoffff
- Re: [SQL] How to optimize this query ? krystoffff