How to eliminate NULL fields in TSQL

前端 未结 1 719
生来不讨喜
生来不讨喜 2021-01-27 16:22

I am developing a TSQL query for SQL Server 2008 R2. I am trying to develop this query to identify one record / client. Because some of these values are NULL, I am currently d

1条回答
  •  伪装坚强ぢ
    2021-01-27 16:48

    Try grouping by group_profile_id and selecting MAX() of every other column. MAX will select the non-null value (if one exists, or the maximum if multiple exist) of each repeating entry. Although the more efficient solution would involve sorting out additional NULL rows in the data, from first glance.

    0 讨论(0)
提交回复
热议问题