回到關系型數據庫理論創立者E
想像一下一個含有SubTotal和TaxRate列的表格
這個原則的一個替換方法叫做計算數據列(computed column)
現在讓我們來假設有一個數據庫
如果沒有計算數據列的話
你可以用下面這個陳述式來創建表格
CREATE TABLE [TestComputedColumns] (
[PK] [int] IDENTITY (
[Length] [int] NOT NULL
[Width] [int] NOT NULL
[Height] [int] NOT NULL
[Coats] [int] NOT NULL CONSTRAINT [DF_TestComputedColumns_Coats] DEFAULT
(
[IncludeCeiling] [bit] NOT NULL CONSTRAINT
[DF_TestComputedColumns_IncludeCeiling] DEFAULT (
[Area] AS ((
[Width] * [IncludeCeiling]) * [Coats])
CONSTRAINT [PK_TestComputedColumns] PRIMARY KEY CLUSTERED
(
[PK]
) ON [PRIMARY]
) ON [PRIMARY]
GO
你可以使用前端
From:http://tw.wingwit.com/Article/program/Oracle/201311/18841.html