首頁 >資料庫 >mysql教程 >财政年度表之建表约束

财政年度表之建表约束

WBOY
WBOY原創
2016-06-07 14:55:171016瀏覽

财政年度表约束 无 Create Table FinancialYear(fiscal_year INTEGER NOT NULL PRIMARY KEY,start_date DATE NOT NULL,CHECK ((EXTRACT(YEAR FROM start_date)=fiscal_year-1)AND (EXTRACT (MONTH FROM start_date)=10)AND (EXTRACT(DAY FROM start_date)=1),

财政年度表约束
Create Table FinancialYear
(fiscal_year INTEGER NOT NULL PRIMARY KEY,
start_date DATE NOT NULL,
CHECK ((EXTRACT(YEAR FROM start_date)=fiscal_year-1)
AND (EXTRACT (MONTH FROM start_date)=10)
AND (EXTRACT(DAY FROM start_date)=1),
end_date DATE NOT NULL,
CONSTRAINT valid_end_date
CHECK ((EXTRACT (YEAR FROM end_date)=fiscal_year)
AND (EXTRACT (MONTH FROM end_date)=9)
AND (EXTRACT (DAY FROM end_date)=30)))
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn