how does NOT EXISTS work?

  • Can someone please explain me this.Based on below does it mean that each row out of the result set from the joins is checked against (Select * from table A

    where col10=b.col10) to see if it exists or not?

    select a.col1,b.col2

    from tableA a

    inner join tableB b

    on a.col1=b.col1

    and NOT EXISTS

    ( Select * from table A

    where col10=b.col10)

  • Honestly, I don't know if that query will cause RBAR without seeing the DDL for both tables and some sample data to test with.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

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

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