У меня две ошибки в местах запросов, проверяйте мои запросы правильно или неправильно. Я новичок в Oracle, поэтому не против
Вот SQL
SQL выдает ошибку: ORA-00909: Invalid Number of Arguments
CREATE VIEW order_summery
AS
SELECT o.id,
o.order_date,(cu.first_name||' '|| cu.last_name) as customer_name
,Sum(NVL(p.price,0)) as total_amount
,Sum(NVL(p.discount_amount,0)) as discount_amount
,NVL(Sum(NVL(p.price,0),0)) - NVL(Sum(NVL(p.discount_amount,0)),0) as final_amount
FROM tbl_order o
INNER JOIN tbl_customer cu on o.customer_id = cu.id
INNER JOIN tbl_order_item oi on o.id= oi.order_id
INNER JOIN tbl_product p on oi.product_id= p.id;
SQL Error: ORA-00936: missing expression
00936. 00000 - "missing expression"
CREATE VIEW sales_report
AS
SELECT o.id,
,o.order_date
,(cu.first_name||' '|| cu.last_name) as customer_name,
,Sum(NVL(p.price,0)) as total_amount
,Sum(NVL(p.discount_amount,0)) as discount_amount
,NVL(Sum(NVL(p.price,0),0)) - NVL(Sum(NVL(p.discount_amount,0)),0) as final_amount
,CASE o.is_deliverd WHEN 'y' THEN 'Deliverd' ELSE 'Not Deliverd' END as status
FROM tbl_order o
INNER JOIN tbl_customer cu on o.customer_id = cu.id
INNER JOIN tbl_order_item oi on o.id= oi.order_id
INNER JOIN tbl_product p on oi.product_id= p.id;