title: Alias to rank not able to use in where clause
body: <pre><code>create table tab1(sno int, name varchar(30), age int);
  
  insert into tab1 values(1, 'abc1', 22);
  insert into tab1 values(2, 'abc2', 23);
  insert into tab1 values(3, 'xyz', 28);
  insert into tab1 values(4, 'abc3', 26);
  insert into tab1 values(5, 'abc4', 25);
  
  select sno, name, age, rank() over (order by sno) as ranking from tab1 where
  ranking = trunc((select count(*)/2 from tab1)) + 1; //This query is giving error
  </code></pre>
  
  <p>Error is ORA-00904: "RANKING": invalid identifier</p>