LIKE on table field values

  • can I create a join using a LIKE statment?

    E.g. I want to to join tables on

    t1.keyword LIKE %t2.profile%

    so if the word in t1.keyword is within the text in t2.profile then there will be a join?

  • Yes you can do this but It isn't very efficient so you should take care where you use it.

    Example:

    Select a.col1, b.col1, etc...

    from TableA a

    join TableB b

    on a.col1 like '%' + b.col1 + '%'

     

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply