本文介绍了SQL 过程错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
改成程序,在'PROCEDURE'处出现语法错误有什么想法吗?
Changed into a procedure, getting a syntax error at 'PROCEDURE' any ideas?
CREATE PROCEDURE performance_Report
@startDate DATE,
@endDate DATE
AS
SELECT Salesrep.Name, SUM(OrderLine.Quantity) AS Total_Sold, SUM(OrderLine.UnitSellingPrice * Orderline.Quantity) AS Total_Value
FROM SalesRep, OrderLine, ShopOrder
WHERE ShopOrder.SalesRepID = SalesRep.SalesRepID
AND OrderLine.ShopOrderID = ShopOrder.ShopOrderID
AND ShopOrder.OrderDate BETWEEN @startDate AND endDate
GROUP BY SalesRep.SalesRepID, SalesRep.Name
ORDER BY Total_Value DESC;
推荐答案
PostgreSQL 没有CREATE PROCEDURE".报告你可能其他数据库中需要的存储过程可以在 PostgreSQL 中使用 CREATE FUNCTION一>.
PostgreSQL doesn't have "CREATE PROCEDURE". It is reported that most of what you might need stored procedures for in other databases can be done in PostgreSQL with CREATE FUNCTION.
这篇关于SQL 过程错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!