title: Combining two column's data into one column in SQL?
body: <p>I am trying to combine Last name, first name and middle name into single sort name column in a SQL statement. Sometime middle name will be <code>NULL</code>, and if that's the case, the sort name is showing <code>NULL</code>.</p>
  
  <p>How to handle this?</p>
  
  <pre><code>SELECT TOP 500
    Last_Name, First_Name, Middle_Name,
    [Last_Name] + ',' + [First_Name] + ' ' + [Middle_Name] AS SORT_NAME
  FROM [dbo].[usr_CUSTOMER]
  ORDER BY SORT_NAME
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code>Last_Name  First_Name   MiddleName  Sort_Name
  Aa         Robert       NULL        NULL
  </code></pre>
  
  <p>But I want to see sort_name to be <code>'Aa,Robert'</code>.</p>