我正在尝试在 mySQL 中创建一个 VIEW ...但我收到此错误.. MySQL 说:文档
1351 - 视图的 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;