Virtual columns

From Oracle FAQ
Jump to: navigation, search

Oracle 11g allows users to add virtual columns to a table based on an expression. No data is stored for Virtual Columns (except for the meta-data). Virtual Columns can be indexed like normal columns.


ALTER TABLE emp ADD (income AS (sal + nvl(comm,0)));
ALTER TABLE emp ADD employment AS (sysdate - hiredate);