1351-view的select包含一个变量或参数

9vw9lbht  于 2021-06-21  发布在  Mysql
关注(0)|答案(0)|浏览(298)

我正在尝试在mysql中创建一个视图。。。但我有个错误。。mysql说:文档

1351-视图的select包含一个变量或参数

我想在视图中使用变量…可以解决什么问题?。。请帮忙。。。

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;

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题