MySQL Forums
Forum List  »  French

Re: aternative à un subquery
Posted by: Huu Da Tran
Date: March 10, 2008 11:46AM

Oups, ça débordait.. alors voici reformatté, en gardant la structure initiale des tables.
select *
from compagnies
left join cie_kw as kw1 using (cie_id)
left join cie_kw as kw2 using (cie_id)
left join cie_kw as kw3 using (cie_id)
where kw1.kw = 'consultants'
    and kw2.kw = 'contractors'
    and kw3.kw = 'toitures';
mais je suis d'avis qu'il serait préférable d'avoir une structure à 3 tables, ne serait-ce que pour ne pas avoir le même mot-clé répété plusieurs fois dans la BD, et il pourrait y survenir des erreurs de typo etc...



Edited 2 time(s). Last edit at 03/10/2008 11:49AM by Huu Da Tran.

Options: ReplyQuote


Subject
Views
Written By
Posted
5667
March 05, 2008 03:28PM
3068
March 08, 2008 11:25AM
Re: aternative à un subquery
3211
March 10, 2008 11:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.