title: T-SQL Column alias on computed column - Invalid column name
body: <p>I'm using an alias to refer to a computed column. Here is a snippet from the actual code I'm trying to make work, to compute similarity and return matches where the similarity score is 3 or higher.</p>
  
  <pre><code>select [FirstName], difference([FirstName], 'mitch') as similarity
  from [Dev].[dbo].[Name]
  where similarity &gt; 2
  order by similarity desc
  </code></pre>
  
  <p>Exception Message:</p>
  
  <blockquote>
    <p>Invalid column name 'similarity'.</p>
  </blockquote>
  
  <p>As similarity is not a real column, how would I make this work?</p>