title: Can I use aliases within a select statement?
body: <p>I would like to write a statement that looks like this</p>
  
  <pre><code>select 1 as one, 2 as two , one + two as three
  </code></pre>
  
  <p>However SQL Server cannot work out what <code>one + two</code> is.</p>
  
  <p>I can re-write in this form</p>
  
  <pre><code>SELECT x.one
        ,x.two
        ,x.one + x.two AS three
  FROM (
      SELECT 1 AS one
            ,2 AS two
      ) x
  </code></pre>
  
  <p>Which gives me the output I expect. It is just a bit messy (and more so in a non-contrived example) I am also not sure what this sort of thing does to the internals of SQL Server and what implications there are to speed of execution.</p>
  
  <p>Is there a better way of doing this?</p>