sql - ORA-00905: Trouble converting Mysql syntax to oracle syntax -
i have mysql code , need convert oracle syntax , faced error. me?
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 (select (case when type = 'out' (case when status = 'draft' (case when read_flag = 'n' 1 else 0 end) else 0 end) else 0 end) send_unread_draft, (case when type = 'out' (case when status = 'draft' (case when read_flag = 'y' 1 else 0 end) else 0 end) else 0 end) send_read_draft, (case when type = 'out' (case when status = 'approved' 1 else 0 end) else 0 end) send_approved, (case when type = 'out' (case when status = 'completed' 1 else 0 end) else 0 end) send_completed, (case when type = 'out' (case when status = 'failed' 1 else 0 end) else 0 end) send_failed, (case when type = 'out' (case when status = 'canceled' 1 else 0 end) else 0 end) send_canceled, (case when type = 'out' (case when status = 'draft' 1 else 0 end) else 0 end) received_draft, (case when type = 'out' (case when status = 'approved' 1 else 0 end) else 0 end) received_approved, (case when type = 'in' (case when status = 'completed' (case when invoice_status = 'accepted' 1 else 0 end) else 0 end) else 0 end) received_accepted_send, (case when type = 'in' (case when status = 'completed' (case when invoice_status = 'rejected' 1 else 0 end) else 0 end) else 0 end) received_rejected_send eis_invoice_header invoice_date between sysdate()-365 , (sysdate + interval '3' month dual)) t
the query
select sysdate + interval '3' month , add_months(sysdate, 3) dual;
same.in query, use
where invoice_date between sysdate- 365 , sysdate + interval '3' month'
Comments
Post a Comment