SQL Server - NOT IN

前端 未结 6 851
情书的邮戳
情书的邮戳 2020-12-29 19:50

I need to build a query that will show me records that are in Table 1, but that are not in Table 2, based on the make-model-serial number combination.

I know for fac

6条回答
  •  爱一瞬间的悲伤
    2020-12-29 20:28

    One issue could be that if either make, model, or [serial number] were null, values would never get returned. Because string concatenations with null values always result in null, and not in () with null will always return nothing. The remedy for this is to use an operator such as IsNull(make, '') + IsNull(Model, ''), etc.

提交回复
热议问题