avant de te repondre, voici ce que j'ai trouvé et qui m a aider:
Citation :
Select all records from a table which do not share a common ID with records from a second table:
select * from table1
where field1 not in (select field2 from table2)
Note: Sub-queries are quite slow and are not supported in MySQL, so the above will not work in MySQL.
or an alternative using a join (which can be much faster):
select table1.* from table1
left join table2 on (table1.field1 = table2.field2)
where table2.field2 is null;
The following method (which has been suggested by Michael Miller) is to use EXISTS. It is much faster on SQL Server than the above (but Michael says it is comparable with the left join technique on Oracle):
select * from table1
where not exists (select field2 from table2 where table2.field2 = table1.field1)
|
apparemment donc, mysql ne gere pas ce genre de requete meme si c'est du SQL correct.
mieux vaux faire une jointure.
j'ai un resultat mais je serai incapable de verifier s'il est coherent
Message édité par veryfree le 15-03-2005 à 15:47:54