Unk*_*own 5 oracle check-constraints
我正在尝试创建一个基本支付(BP)表
CREATE TABLE bp (
bpid VARCHAR(5),
FOREIGN KEY (bpid) REFERENCES designation(desigid),
upperlimit DECIMAL(10,2) NOT NULL,
lowerlimit DECIMAL(10,2) NOT NULL,
increment DECIMAL(10,2) NOT NULL
CONSTRAINT llvalid CHECK (upperlimit > lowerlimit)
);
Run Code Online (Sandbox Code Playgroud)
正如你在结尾附近看到的那样,我想检查是否upperlimit大于lowerlimit,我该怎么做?
它可能(可能确实)取决于您使用的数据库.
与oracle语法相比(例如:http://www.techonthenet.com/oracle/check.php),您缺少的可能是NULL和CONSTRAINT之间的','