title: SQL: Concatenate column values in a single row into a string separated by comma
body: <p>Let's say I have a table like this in SQL Server:</p>
  
  <pre><code>Id    City           Province             Country
  1     Vancouver      British Columbia     Canada
  2     New York       null                 null
  3     null           Adama                null
  4     null           null                 France
  5     Winnepeg       Manitoba             null
  6     null           Quebec               Canada
  7     Seattle        null                 USA 
  </code></pre>
  
  <p>How can I get a query result so that the location is a concatenation of the City, Province, and Country separated by ", ", with nulls omitted.  I'd like to ensure that there aren't any trailing comma, preceding commas, or empty strings.  For example:</p>
  
  <pre><code>Id    Location
  1     Vancouver, British Columbia, Canada
  2     New York
  3     Adama
  4     France
  5     Winnepeg, Manitoba
  6     Quebec, Canada
  7     Seattle, USA
  </code></pre>