Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012
    Posts
    82

    Unanswered: DB2 text search between 2 columns

    Hi,
    I have 2 columns in 2 tables both have account names. I want to compare one column to another.

    There is a master table and a slave table. I want to check how many of slave table account names are in parents. I need fuzzy search as the Names maybe a little different.


    Something like this but this is multiple result into a scalar function.

    SELECT BLUEID_ACCOUNT_ID, ACCOUNT_NAME FROM BLUEID_ACCOUNT_DIM WHERE CONTAINS(ACCOUNT_NAME,
    (SELECT ACCOUNT_NAME FROM HWSW_ACCOUNT_DIM)) =1

    Any ideas??

  2. #2
    Join Date
    Apr 2012
    Posts
    156
    Hi, one question, when you say "fuzzy" search, how fuzzy are we talking? Would the text be the same for each account name with different cases, or would some be completely different? For example it is pretty easy to compare: Table1 - Account Name1 to Table2 - account name1
    However if you are comparing something like: Table 1 - Account Name1 to Table2 - Acct. name 1, that can be a bit more difficult.

  3. #3
    Join Date
    Jan 2012
    Posts
    82
    Trying to do the later.

  4. #4
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    no fuzzy compare is going to put those two together. That would be a manual one. You could use except, then once you see the type of data you get back then you might be able to apply some logic or soundex function to it. Been awhile since I messed with soundex, but I think you should be able to say above nth of a match.
    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •