1351 - 视图的SELECT包含变量或参数

时间:2018-05-13 13:50:53

标签: mysql stored-procedures mysql-variables

我正在尝试在mySQL中创建一个VIEW ...但是我收到了这个错误.. MySQL说:文档

1351 - View的SELECT包含变量或参数

我想在VIEW中使用变量......可以解决什么问题?..请帮忙......

CREATE VIEW SHOPPING_CART_ITEM as select pm.Id AS Id, pm.Desc AS 
Description, p.Name AS manufacturerName, p.manufId AS manufId, cat.Name AS
categoryName, cat.Id AS categoryId, pm.Date AS ManufDate, 
cartItem.Quantity AS quanity, pm.Unit AS Unit, pm.UnitPrice AS UnitPrice,
 @_totalItemAmount := (pm.SellingUnitPrice * cartItem.Quantity) AS
 TotalItemAmount, @_totalItemAmountIncDiscount :=
 (FUN_calculateNetItemAmountAfterStandardDiscount(pm.Id,cartItem.Quantity
,NULL,NULL)) AS TotalItemAmountIncDiscount, (@_totalItemAmount -
 @_totalItemAmountIncDiscount) AS DiscountApplied from PRODUCT pm left
 join CATEGORY cat on pm.CategoryId = cat.Id left join PARTY p on
 pm.manufId = p.Id left join CART_ITEM cartItem on pm.Id =
 cartItem.ProductId left join CART cart on cartItem.CartId = cart.Id;

0 个答案:

没有答案