Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Want to use analytical function as a Virtual column

718981Nov 18 2009 — edited Nov 18 2009
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2009
Added on Nov 18 2009
2 comments
1,084 views