SELECT *
FROM orders do
WHERE (CASE TO_CHAR(sysdate,'D')
WHEN '1' THEN do.create_date=sysdate
WHEN '2' THEN do.create_date BETWEEN sysdate-1 AND sysdate
WHEN '3' THEN do.create_date BETWEEN sysdate-2 AND sysdate
WHEN '4' THEN do.create_date BETWEEN sysdate-3 AND sysdate
WHEN '5' THEN do.create_date BETWEEN sysdate-4 AND sysdate
WHEN '6' THEN do.create_date BETWEEN sysdate-5 AND sysdate
WHEN '7' THEN do.create_date BETWEEN sysdate-6 AND sysdate
END)
这有什么问题?我收到以下错误消息
Error Msg :
ORA-00905: missing keyword
00905. 00000 - "missing keyword"
*Cause:
*Action:
Error at Line: 46 Column: 37