• Jeff Moden (8/28/2015)


    Before you go to all that trouble, try changing "postalid" to "*" or "1" in the not exists and see what happens.

    That won't do anything. The SELECT list for an exists is completely ignored, it's not processed in any way. You can put SELECT 1/0 in an EXISTS and it'll still run fine.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass