Not Equal in Inner Join not working

  • Paul White NZ (3/20/2010)


    Lynn Pettis (3/20/2010)


    Thinking about it, it may have been done inside a WHERE clause, not the ON portion of JOIN clause. Just not enough time to go searching through the forum posts where I have done it before when assisting others with what could be a similar (but different) problem.

    Don't worry about it, Lynn. The boolean transformation is pretty straight forward - I was just pointing out that in your posted code, all you did was swap an AND for an OR - you need to reverse the signs and introduce a NOT . Just an oversight on your part, I am sure...but thought I should mention it.

    Okay, I must be brain dead (I am trying to do my taxes, very mind numbing) plus I already trashed my test suite, care to elaborate a bit more for me?

  • Lynn Pettis (3/20/2010)


    Okay, I must be brain dead (I am trying to do my taxes, very mind numbing) plus I already trashed my test suite, care to elaborate a bit more for me?

    Ok. Say {A, B} = {table1.PID, table2.PID} and {C, D} = {table1.SSN, table2.SSN}

    You changed (A <> B) AND (C <> D) into (A <> B) OR (C <> D).

    It should have been NOT((A = B) OR (C = D)).

  • Paul White NZ (3/20/2010)


    Lynn Pettis (3/20/2010)


    Okay, I must be brain dead (I am trying to do my taxes, very mind numbing) plus I already trashed my test suite, care to elaborate a bit more for me?

    Ok. Say {A, B} = {table1.PID, table2.PID} and {C, D} = {table1.SSN, table2.SSN}

    You changed (A <> B) AND (C <> D) into (A <> B) OR (C <> D).

    It should have been NOT((A = B) OR (C = D)).

    Okay. Clears things up, amazing what "pictures" will do.

    Thanks.

  • Lynn Pettis (3/20/2010)


    Okay. Clears things up, amazing what "pictures" will do.

    No worries 🙂

    Good luck with the tax calculations!

  • Honestly, I'm really excited.

    I really like the spirit.

    I thought, I posted a simple question. And I'm surprised by the solutions, counters and clarifications on each thread. The reason why it is called as a CENTRAL for SqlServer.

    Thanks dear, Geeks.

    🙂

    ---
    .NET Developer
    Blog: Did you say .NET?[/url]
    Follow me on Twitter

  • Thanks,It's saved my time

Viewing 6 posts - 16 through 20 (of 20 total)

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