Say I have something like below for example. I think it is impossible to use the newly created rowid
as a condition for a case when
var or am I wrong? I could create a temp table but is there another way I can use rowid
as a condition for a new case when
variable, preferably without using temp tables?
select
* from (select ROW_NUMBER()OVER(partition by id ORDER BY id) as rowid ,
case when rowid > 1 then 'a' else 'b' end as newvar
from tableA) as A