Home Forums SQL Server 2005 T-SQL (SS2K5) find out which record_ids match on 2 fields and not match a third field. RE: find out which record_ids match on 2 fields and not match a third field.

  • Matt's solution is more efficient than mine. I thought about using a CTE, but have not used them enough to be comfortable. If you set statustics IO on my solution returns:

    Scan count 2, logical reads 15 physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

    And Matt's:

    Scan count 2, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.