title: How to get only the max row number row of record?
body: <p>Below query results the record as follows ..</p>
  
  <p>How to get only the max row number row of record?  I have run this query for over 20,000 records to identify duplication and get the most recent date and its number of processed (RowNumber).</p>
  
  <pre><code>select [FileName], ProcessDate,
  ROW_NUMBER() over (partition by [FileName] order by [FileName] desc) RowNumber 
  from  StagingTable
  where filename = 'abc.txt'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/kDo0k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kDo0k.png" alt="enter image description here"></a></p>