📜  oracle 计算列 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:20.690000             🧑  作者: Mango

代码示例1
CREATE TABLE T1 (
    ID          NUMBER,
    PRODUCT     VARCHAR2(50),
    PRICE       NUMBER(10, 2),
    TAXED_PRICE NUMBER(10, 2) GENERATED ALWAYS AS (round(PRICE * 1.2, 2)) VIRTUAL
);
INSERT INTO T1 (ID, PRODUCT, PRICE) VALUES (1, 'Spoon', 12);