我有一个 mysql 代码,需要将其转换为 Oracle 语法,我遇到了这个错误。有人可以帮我吗?
SELECT SUM(T.SEND_UNREAD_DRAFT) SEND_UNREAD_DRAFT, SUM(T.SEND_READ_DRAFT) SEND_READ_DRAFT,
SUM(T.SEND_APPROVED) SEND_APPROVED, SUM(T.SEND_COMPLETED) SEND_COMPLETED,
SUM(T.SEND_FAILED)SEND_FAILED,SUM(T.RECEIVED_DRAFT)RECEIVED_DRAFT,SUM(T.RECEIVED_APPROVED)RECEIVED_APPROVED,
Sum(T.Received_Accepted_Send)Received_Accepted_Send,Sum(T.Received_Rejected_Send)Received_Rejected_Send, Sum(T.Send_Canceled)Send_Canceled
FROM
(SELECT
(CASE WHEN TYPE = 'OUT' THEN (CASE WHEN STATUS = 'DRAFT' THEN (CASE WHEN READ_FLAG = 'N' THEN 1 ELSE 0 END) ELSE 0 END) ELSE 0 END) SEND_UNREAD_DRAFT,
(CASE WHEN TYPE = 'OUT' THEN (CASE WHEN STATUS = 'DRAFT' THEN (CASE WHEN READ_FLAG = 'Y' THEN 1 ELSE 0 END) ELSE 0 END) ELSE 0 END) SEND_READ_DRAFT,
(CASE WHEN TYPE = 'OUT' THEN (CASE WHEN STATUS = 'APPROVED' THEN 1 ELSE 0 END) ELSE 0 END) SEND_APPROVED,
(CASE WHEN TYPE = 'OUT' THEN (CASE WHEN STATUS = 'COMPLETED' THEN 1 ELSE 0 END) ELSE 0 END) SEND_COMPLETED,
(CASE WHEN TYPE = 'OUT' THEN (CASE WHEN STATUS = 'FAILED' THEN 1 ELSE 0 END) ELSE 0 END) SEND_FAILED,
(CASE WHEN TYPE = 'OUT' THEN (CASE WHEN STATUS = 'CANCELED' THEN 1 ELSE 0 END) ELSE 0 END) SEND_CANCELED,
(CASE WHEN TYPE = 'OUT' THEN (CASE WHEN STATUS = 'DRAFT' THEN 1 ELSE 0 END) ELSE 0 END) RECEIVED_DRAFT,
(CASE WHEN TYPE = 'OUT' THEN (CASE WHEN STATUS = 'APPROVED' THEN 1 ELSE 0 END) ELSE 0 END) RECEIVED_APPROVED,
(CASE WHEN TYPE = 'IN' THEN (CASE WHEN STATUS = 'COMPLETED' THEN (CASE WHEN INVOICE_STATUS = 'ACCEPTED' THEN 1 ELSE 0 END) ELSE 0 END) ELSE 0 END) RECEIVED_ACCEPTED_SEND,
(CASE WHEN TYPE = 'IN' THEN (CASE WHEN STATUS = 'COMPLETED' THEN (CASE WHEN INVOICE_STATUS = 'REJECTED' THEN 1 ELSE 0 END) ELSE 0 END) ELSE 0 END) RECEIVED_REJECTED_SEND
From Eis_Invoice_Header
Where Invoice_Date Between Sysdate()-365 And (sysdate + Interval '3' Month from dual)) as T