Join two tables and use contain ??

  • I need to join two tables and search using the contain statement, how do you do this ?

    It works with '%like%' but you cant use join and contain, what is a workaround ?

    Thanks

  • You can join the two tables and use a CONTAINS predicate on each of them with the same search argument.

    E.g.:

    select<column list>

    from<table 1> t1

    <inner or outer?> join<table 2> t2

    ont2.<common key> = t1.<common key>

    where(contains(t1.<fts column>, <search argument> ))

    <and, or?> (contains(t2.<fts column>, <search argument> ))

    ML

    ---
    Matija Lah, SQL Server MVP
    http://milambda.blogspot.com

  • Many Thanks !

  • No problem. 🙂

    Post Back and let us know how you get on!

    ML

    ---
    Matija Lah, SQL Server MVP
    http://milambda.blogspot.com

Viewing 4 posts - 1 through 3 (of 3 total)

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