title: COALESCE with NULL
body: <p>I found this snippet of SQL in a view and I am rather puzzled by it's purpose (actual SQL shortened for brevity):</p>
  
  <pre><code>SELECT
      COALESCE(b.Foo, NULL) AS Foo
  
  FROM a
  LEFT JOIN b ON b.aId=a.Id
  </code></pre>
  
  <p>I cannot think of a single reason of the purpose of coalescing with null instead of just doing this:</p>
  
  <pre><code>SELECT
      b.Foo AS Foo
  
  FROM a
  LEFT JOIN b ON b.aId=a.Id
  </code></pre>
  
  <p>Or at the very least don't include the NULL explicitly:</p>
  
  <pre><code>SELECT
      COALESCE(b.Foo) AS Foo
  
  FROM a
  LEFT JOIN b ON b.aId=a.Id
  </code></pre>
  
  <p>I don't know who authored this (so I cannot ask), when it was authored, or for what specific MS SQL Server version it was written for (pre-2008 for sure though).</p>
  
  <p><b>Is there any valid reason to coalesce with NULL instead of just selecting the column directly?</b>  I can't help but laugh and write it off as a rookie mistake but it makes me wonder if there is some "fringe case" that I don't know about.</p>