HELP !! - MySQL version 4 query slowing killing me

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason Tomlins

    HELP !! - MySQL version 4 query slowing killing me

    I want to create a query that will select all the rows in table A that
    dont appear in table B based on a column of ints that appears in both
    tables. In other words table A has a column of memberIDs and table B
    has a column of memberIDs. I want to select all the memberIDs from
    table A that dont appear in table B.

    Appreciate any advice.


  • Bill Karwin

    #2
    Re: HELP !! - MySQL version 4 query slowing killing me

    Jason Tomlins wrote:
    [color=blue]
    > I want to create a query that will select all the rows in table A that
    > dont appear in table B based on a column of ints that appears in both
    > tables. In other words table A has a column of memberIDs and table B
    > has a column of memberIDs. I want to select all the memberIDs from
    > table A that dont appear in table B.[/color]

    Don't let SQL slowly kill you! This is simply an outer join problem:

    SELECT DISTINCT A.memberID
    FROM A LEFT OUTER JOIN B ON A.memberID = B.memberID
    WHERE B.memberID IS NULL

    Regards,
    Bill K.

    Comment

    • Jason Tomlins

      #3
      Re: HELP !! - MySQL version 4 query slowing killing me

      Bill Karwin <bill@karwin.co m> wrote in message news:<cdp0v90q1 o@enews3.newsgu y.com>...[color=blue]
      > Jason Tomlins wrote:
      >[color=green]
      > > I want to create a query that will select all the rows in table A that
      > > dont appear in table B based on a column of ints that appears in both
      > > tables. In other words table A has a column of memberIDs and table B
      > > has a column of memberIDs. I want to select all the memberIDs from
      > > table A that dont appear in table B.[/color]
      >
      > Don't let SQL slowly kill you! This is simply an outer join problem:
      >
      > SELECT DISTINCT A.memberID
      > FROM A LEFT OUTER JOIN B ON A.memberID = B.memberID
      > WHERE B.memberID IS NULL
      >
      > Regards,
      > Bill K.[/color]

      Many thanks for that Bill, appreciate it.

      Regards,
      Jason.

      Comment

      Working...