我需要一个约束来阻止未来的日期被添加..所以它是< = sysdate或< =当前日期......
CREATE TABLE "ORDER"
(OrderNo NUMERIC (6),
OrderDate DATE DEFAULT SYSDATE NOT NULL,
Paid CHAR(1) NOT NULL,
TotalAmount NUMERIC(6,2) DEFAULT 0 NOT NULL,
CustomerID NUMERIC(6) NOT NULL,
SalesRepID NUMERIC(7) NOT NULL,
CONSTRAINT Order_OrderNo_PK PRIMARY KEY (OrderNo),
CONSTRAINT Order_CustomerID_FK FOREIGN KEY (CustomerID) REFERENCES Customer(PersonID),
CONSTRAINT Order_SalesRepID_FK FOREIGN KEY (SalesRepID) REFERENCES Employee(PersonID),
CONSTRAINT Order_OrderNo_CC CHECK (OrderNo >=1),
CONSTRAINT Order_Paid_CC CHECK (UPPER(Paid) IN('Y','N')),
CONSTRAINT Order_TotalAmount_CC CHECK (TotalAmount >= 0.00)
);