2 Replies Latest reply: Nov 6, 2011 12:55 PM by Adam Booth RSS

    WHERE clause for one to many relationship

      Hi,

       

      I have a bit of a problem with an import script using some interesting WHERE clauses. Any help in getting out of this one would be appreciated.

       

      I have two tables, CALLS and KEYWORDS which share the common field Call_No. The KEYWORD table has an additional field called Keyword. The KEYWORD table contains both primary and secondary keywords with no distinction between them exept a # at the start of the primary keywords. I am looking for Call_No with a primary Keyword #BNMS and then need to return all Keyword for that Call_No.

       

      For Example

       

      CALLS

      Call_No
      12345
      23456
      34567

       

      KEYWORDS

      Call_NoKeyword
      12345#BNMS
      12345Other
      23456#BNMS
      23456Hosting
      34567Support

       

      I would hope to get something like this

       

      CALLS
      12345
      23456

       

      KEYWORDS
      #BNMS
      Other
      Hosting

       

      Thanks in advance,

       

      Adam