bonjour,
est il y a un moyen pour faire une selection sur un couple.
par exemple faire :
Code:
1
2
3
4 select champ1,champ2 from table where (champ1,champ2) in select champ1', champ2' from table2)
Version imprimable
bonjour,
est il y a un moyen pour faire une selection sur un couple.
par exemple faire :
Code:
1
2
3
4 select champ1,champ2 from table where (champ1,champ2) in select champ1', champ2' from table2)
pourquoi pas avec 'and'?
Code:
1
2
3
4 select champ1,champ2 from table where champ1 in (select champ1' from table 2) and champ2 in (select champ2' from table2)
Non C_C... cela ne donne pas la même chose.
Code:
1
2
3
4 select t1.champ1, t1.champ2 from table1 t1 inner join table2 t2 ON t1.champ1 = t2.champ1 AND t1.champ2 = t2.champ2
salut.
D'accord avec Fadace, mais si ( champ1, champ2 ) ne forme pas une clé unique pour table2 alors
Code:
1
2
3
4
5 select t1.champ1, t1.champ2 from table1 t1 inner join ( select distinct champ1, champ2 from table2 ) t2 on ( t1.champ1 = t2.champ1 ) And ( t1.champ2 = t2.champ2 )