Archives of the TeradataForum
Message Posted: Thu, 12 Jun 2008 @ 10:34:38 GMT
You really have some ugly data in that Table_b. 3.5 million rows you say? That is worse than ugly, more like ugly's ugly brother.
As long as you go through and get rid of all the "-" (WITH RECURSIVE might be a good approach for this), you could do the following, but it will not be fast with the volume of your ugly data:
WHERE POSITION(table_a.animal IN table_b.comment) > 0 AND POSITION(table_a.color IN table_b.comment) > 0 AND table_b.PetStoreID <> table_a.PetStoreID
Hope this helps,
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|