SQL Server JOIN missing NULL values

前端 未结 8 1483
感情败类
感情败类 2020-12-04 15:15

Suppose I had the following 2 tables:

      Table1:                                Table2:
Col1:      Col2:     Col3:             Col1:       Col2:       Col         


        
8条回答
  •  再見小時候
    2020-12-04 15:42

    The only correct answer is not to join columns with null values. This can lead to unwanted behaviour very quickly.

    e.g. isnull(b.colId,''): What happens if you have empty strings in your data? The join maybe duplicate rows which I guess is not intended in this case.

提交回复
热议问题