title: SQL Server - 'AS' option in WHERE clause
body: <p>I am trying to execute the following SQL command on SQL Server:</p>
  
  <pre><code>   select a1, 
             a2,
      ....
              (select [dbo].[myFunction](a1, a2)) as mySelector
      where mySelector = @sel    
  </code></pre>
  
  <p>The error message says:invalid column name mySelector</p>
  
  <p>I tried also "as 'mySelector'" - the same error  message </p>
  
  <p>Any ideas why?</p>
  
  <p>Thanks,</p>
  
  <p>zb</p>