trids
Programmer
- Feb 23, 2001
- 21
Hi folks .. two questions:
Q1 = Any ideas on the best way to accomplish the following in only one statement?
SELECT
lhs = L.match_no,
rhs = R.match_no
INTO
#TMP
FROM
#LHS L,
#RHS R
WHERE
L.match_no *= R.match_no
-- DROP matches
DELETE FROM #TMP WHERE rhs != NULL
Q2 = How does a subquery compare, performance-wise?..
SELECT
match_no
INTO
#TMP
FROM
#LHS L
WHERE
match_no NOT IN(SELECT match_no FROM #RHS)
Q1 = Any ideas on the best way to accomplish the following in only one statement?
SELECT
lhs = L.match_no,
rhs = R.match_no
INTO
#TMP
FROM
#LHS L,
#RHS R
WHERE
L.match_no *= R.match_no
-- DROP matches
DELETE FROM #TMP WHERE rhs != NULL
Q2 = How does a subquery compare, performance-wise?..
SELECT
match_no
INTO
#TMP
FROM
#LHS L
WHERE
match_no NOT IN(SELECT match_no FROM #RHS)