Hi,
Here's my problem. I need to write a query that checks to see if some values do NOT exist in a table (as compared to another table). If they don't exist, I want the query to select the non-existing values in a "array", so that I can email the list.
This is what I have so far, but it's wrong:
SELECT @Industry = Industry
FROM CR_TABLE
WHERE Industry NOT IN
(SELECT Industry FROM V_TABLE)
As you can see, the problem is that you can't put a list into the @Industry variable.
I am wondering the correct way to do this!
Thanks much
Here's my problem. I need to write a query that checks to see if some values do NOT exist in a table (as compared to another table). If they don't exist, I want the query to select the non-existing values in a "array", so that I can email the list.
This is what I have so far, but it's wrong:
SELECT @Industry = Industry
FROM CR_TABLE
WHERE Industry NOT IN
(SELECT Industry FROM V_TABLE)
As you can see, the problem is that you can't put a list into the @Industry variable.
I am wondering the correct way to do this!
Thanks much