• Correct you do get a No predicate join warning on the join in the Execution plan, and the predicate on the #tmp table shows as tempdb.dbo.#tmp.myColumn=tempdb.dbo.#tmp.myColumn.

    It seems SQL is trying to be clever, though I'd probably want it to throw an error if the column didnt exist in the sub query, but thats me.

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices