createtable example ( id bigint generated always asidentity, a integer , b integer , c integer GENERATED ALWAYS AS (CASE WHEN ((a ISNOTNULL) AND (b ISNOTNULL) AND (b >0)) THENfloor(((a / b))::double precision) ELSENULL::double precision END) STORED )
1 2 3 4 5 6
createtable example ( id bigint generated always asidentity, a timestampnotnull , b char(4) GENERATED ALWAYS AS (EXTRACT(yearFROMdate))::text) STORED )
Virtual column
1 2 3 4 5 6 7 8 9 10 11 12 13 14
createtable example ( id bigint generated always asidentity, a integer , b integer , c integer GENERATED ALWAYS AS (CASE WHEN ((a ISNOTNULL) AND (b ISNOTNULL) AND (b >0)) THENfloor(((a / b))::double precision) ELSENULL::double precision END) )
1 2 3 4 5 6
createtable example ( id bigint generated always asidentity, a timestampnotnull , b char(4) GENERATED ALWAYS AS (EXTRACT(yearFROMdate))::text) )