si une ligne de tab1 existe dans un ens de lignes de tab2 je la supprime
en oracle c'est:
delete from tab1
where ( col1, col2, col2)
IN ( select col1, col2, col2
from tab2
where cond
);
quelle est la requête equiv en T-SQL?
Version imprimable
si une ligne de tab1 existe dans un ens de lignes de tab2 je la supprime
en oracle c'est:
delete from tab1
where ( col1, col2, col2)
IN ( select col1, col2, col2
from tab2
where cond
);
quelle est la requête equiv en T-SQL?
Autre solution :Code:
1
2
3
4
5 delete from tab1 FROM tab1 T1 INNER JOIN tab2 T2 ON T1.col1 = T2.col1 AND T1.col2 = T2.col2 AND T1.col3 = T2.col3 where cond
Code:
1
2
3
4
5 delete from tab1 WHERE EXISTS(SELECT * FROM tab2 T2 WHERE tab1.col1 = T2.col1 AND tab1.col2 = T2.col2 AND tab1.col3 = T2.col3) where cond
A +