



























create procedure sp_get_product_allprice
@fld_uid int
as
declare @sumprice float
set @sumprice=0
declare cur_cart cursor
for
select fld_price,fld_count
from tbl_product where fld_uid = @fld_uid
for read only
open cur_cart
declare @product_price float
declare @product_count int
fetch next from cur_cart into @product_price,@product_count
while @@fetch_status = 0
begin
set @sumprice = @sumprice + (@product_price * @product_count)
fetch next from cur_cart into @product_price,@product_count
end
close cur_cart
DEALLOCATE cur_cart
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。