title: Replacing max(columnname) with a different query
body: <p>I am working with a number of tables, where developer used 'max(columnname)' on its own to get the most recent entry in a column. This can cause performance bottlenecks so I'm trying to replace max(columnname) with the alternative queries.</p>
  
  <p>I thought of:</p>
  
  <p><code>select [column name], max(1) from [table] order by [column name]</code></p>
  
  <p>and</p>
  
  <pre><code>select top 1 [column name] from [table] order by [column name] desc
  </code></pre>
  
  <p>Do you think one of the above would work well? If not, do you have any suggestions how to build a better query?</p>