title: How do you have a subquery in the alias definition of a column (in the AS statement)
body: <p>Creating an alias for a result in a query is no problem</p>
  
  <pre><code>select VALUE as ALIAS from TABLE 
  </code></pre>
  
  <p>But what if I want the alias to be dynamic? My first thought would be to have a subquery in the AS statement, but SQL hates it apparently.</p>
  
  <pre><code>select VALUE1 as (select VALUE2 from TABLE2 where A=B) from TABLE1
  </code></pre>
  
  <p>This throws an error:</p>
  
  <blockquote>
    <p>.Incorrect syntax near '('.</p>
  </blockquote>