我有一个使用 CREATE 和 INSERT INTO 语句填充的数据库。我现在正在尝试编写一个 CASE statemenet,它将显示其 payment_due_date 已超过今天日期的“客户”。下面是下面的代码
创建语句'Ord'(订单)
CREATE TABLE Ord(OrderID varchar2(9) PRIMARY KEY,
CustomerID varchar(9) REFERENCES Customer(CustomerID),
Expected_Delivery_Date date DEFAULT sysdate NOT NULL,
Actual_Delivery_Date date DEFAULT sysdate NOT NULL,
Payment_Due_Date date DEFAULT sysdate NOT NULL,
Order_Date date DEFAULT sysdate NOT NULL, Price Varchar(10),
Order_Placed varchar2(1) CONSTRAINT OrderPlaced
CHECK(Order_Placed IN('Y','N')) NOT NULL, Order_Confirmed varchar2(1)
CONSTRAINT Order_Confirmed CHECK(Order_Confirmed IN('Y','N'))
NOT NULL, Order_Completed varchar2(1) CONSTRAINT Order_Completed
CHECK(Order_Completed IN('Y','N')) NOT NULL)
插入声明
INSERT INTO Ord VALUES(401565981, 501623129,
'10-Dec-10', '11-Dec-10', '07-Dec-10', '03-Dec-10','£14.99', 'Y', 'Y', 'Y')
案例陈述
SELECT OrderID, CustomerID, Payment_Due_Date CASE WHEN
Payment_Due_Date = '08-Dec-10' THEN 'Send Final Demand Letter'
ELSE 'Do not send letter'
END FROM Ord;
当我尝试运行上述案例语句时,我收到以下错误
ORA-00923:在预期的地方找不到 FROM 关键字 00923。00000 -“在预期的地方找不到 FROM 关键字” *原因:
*操作:行错误:26 列:50
有没有办法解决这个问题?