Si j'ai bien compris ton besoin, ca devrait ressembler à quelque chose comme ça :
Code :
- select *
- from table
- where
- exists (select 1
- from table
- where champ1 like '%$item1%')
- and exists (select 1
- from table
- where champ1 like '%$item2%')
- and exists (select 1
- from table
- where champ2 like '%$item1%'
- or champ3 like '%$item1%')
- and exists (select 1
- from table
- where champ2 like '%$item2%'
- or champ3 like '%$item2%')
|
par contre autant de like c'est pas terrible pour les perfs, tu ne peux pas faire une équi-jointure ?