title: aggregate function using alias name and fetch the result into the resultset using the Alias name given for that function which uses alias name
body: <p>I have to perform calculation using aggregate function by specifying the alias name inside that function and retrieve the data into my resultset using the alias name given for that aggregate function... when I tried to do that I got an Exception saying "Invalid Identifier" how to resolve this?</p>
  
  <p><strong>To be more clear</strong>, Am using alias name inside my aggregate function and giving alias name for the final result obtained by this aggregate function. so now my question is how to fetch the value returned by the aggregate function into my resultset? When I try to retrieve that through my Resultset in java code, It is throwing Exception. how to resolve this issue?</p>
  
  <p>my Query:</p>
  
  <pre><code>select customername,
         to_char(dt,'ddmonyy'),
         lpad(sum(AliasNAme2),15) as AliasName
  from (
    select customername,
           dt,
           sum(traffic) as AliasNAme2
    from table
    where dt &gt;= trunc (SYSDATE -1)
    group by customername,
             dt,
             0,
             0,
             0
  )
  group by customername,
           to_char(dt,'ddmonyy'),
  having customername = 'BB'
  </code></pre>
  
  <p>I got an error <strong>"Invalid Identifier"</strong> when I try to fetch the data using the following java code</p>
  
  <pre><code>rs.getInt("AliasName");
  </code></pre>