从PostgreSQL中两个列值的减值创建表列

时间:2019-01-29 06:45:29

标签: postgresql

我正在从sqlserver迁移到postgresql。并在sqlserver中有一个表,该表创建一个表列,该表列从其他两列中减去值。可以在sqlserver中完成,但不能在PostgreSQL中完成。

CREATE TABLE "AUDIT_LOG"
("Id" integer NOT NULL DEFAULT ,
"DateTime" timestamp without time zone,
"Source_Database" character varying(100),
"Target_Database" character varying(100),
"Source_Table" character varying(100),
"Target_Table" character varying(100),
"Source_Record_Count" integer,
"Target_Record_Count" integer,
"Variance" AS (Source_Record_Count-Target_Record_Count)
)

如何在postgresql中具有等效的创建脚本?

0 个答案:

没有答案
相关问题