title: List or concatenate in SQL window function
body: <p>A (relatively new to SQL) member of my team was working on writing an SQL query that happened to use a window function.  Upon reviewing I noted that they structured their window function like this:</p>
  
  <pre><code>COUNT(*) OVER(PARTITION BY Part1+Part2) AS A
  </code></pre>
  
  <p>Which I instantly made a feedback note to say it should be like this:</p>
  
  <pre><code>COUNT(*) OVER(PARTITION BY Part1, Part2) AS A
  </code></pre>
  
  <p>Both Part1 and Part2 are nvarchars.</p>
  
  <p>Then I paused to reflect and I couldn't actually work out <em>why</em> that would be wrong.  As far as I can see that would actually produce identical results (it does).  The actual execution plan is nearly identical aside from an extra Compute Scalar step after the initial table scan on the first query (this is 0% of query cost).  The I/O statistics show that the first version has 5 fewer logical reads (12,665 to 12,670).</p>
  
  <p>So is there any benefit/detriment to using either form, aside from coding conventions?  Is it a case that this works fine in this instance, but in certain circumstances could produce inconsistent results? </p>