title: Add ID column to a query result
body: <p>This is my first time asking a question about T-SQL and I am a beginner with it. I have a SQL query which consists of two CTE's filtered down to less than 10 rows. I am using a SUM statement to get a running total:</p>
  
  <pre><code>Sum(Diff) OVER(ORDER BY DateAdded) AS Summary
  </code></pre>
  
  <p><code>DateAdded</code> has the same value for several rows. Therefore, it does not give me a running total for each row. I need to create a field that simply counts the number of rows (similar to a PK in a DB table) so I can use it for my <code>ORDER BY</code> clause. If my understanding is correct, this is what I need to do to make it work. How can I add an enumerated column to the query result set? Please note, I do not want to <code>ALTER</code> a table, just add a column to the query result. I hope what I wrote is clear. Thank you!</p>