Hi all
I have a bit of a dilema that I am hoping some of you smart dudes
might be able to help me with.
1. I have a table with about 50 million records in it and quite a few
columns. [Table A]
2. I have another table with just over 300 records in it and a single
column (besides the id). [Table B]
3. I want to:
Select all of those records from Table A where [table A].description
does NOT contain any of (select color from [table B])
4. An example
Table A
id ... [other columns] ... description
1 the green hornet
2 a red ball
3 a green dog
4 the yellow submarine
5 the pink panther
Table B
id color
55 blue
56 gold
57 green
58 purple
59 pink
60 white
So I want to select all those rows in Table A where none of the words
from Table B.color appear in the description field in Table A.
I.E: The query would return the following from Table A:
2 a red ball
4 the yellow submarine
The real life problem has more variables and is a little more
complicated than this but this should suffice to give me the right
idea.
Due to the number of rows involved I need this to be relevantly
efficient. Can someone suggest the most efficient way to proceed.
PS. Please excuse my ignorance.
Cheers
Sean