Want to use analytical function as a Virtual column
718981Nov 18 2009 — edited Nov 18 2009I am wondering if I can use an analytic function as a virtual column to a table?
The table conatins a field named BUSINESS_RUN_DATE, which becomes the EXPIRY_DATE of the on the previous record. So we want to add this value right into the table without resorting t a view.
This is what I tried to add the column to the table:
alter table stg_xref_test_virtual
ADD (expiry_date2 date generated always AS (max (business_run_date) over
*(PARTITION BY ntrl_src_sys_key order by business_run_date*
rows between 1 preceding and 1 following))) ;
It give me an error that GROUP BY is not allowed.
Can someone help out>?
Thanks,
Ian