您的当前位置:首页 >数据库 >MySQL VS SQL Server之用法差别 正文

MySQL VS SQL Server之用法差别

时间:2025-11-04 21:07:32 来源:网络整理编辑:数据库

核心提示

复制declare@tempShoppingCarttable(ProductIdint,Quantityint) insertinto@tempShoppingCart(Pr

MySQL VS SQL Server之用法差别
复制declare @tempShoppingCart table (ProductId int,法差 Quantity int)   insertinto @tempShoppingCart (ProductId, Quantity)   select ProductId, Quantity from ShoppingCart where UserGuid = @UserGuid   declare @productId int declare @quantity int declare tempCartCursor cursorfor select ProductId, Quantity from @tempShoppingCart   open tempCartCursor   fetchnextfrom tempCartCursor into @productId, @quantity   while  @@FETCH_STATUS = 0   begin update Product set SellCount = SellCount + @quantity    where productId = @productId   fetchnextfrom tempCartCursor into @productId, @quantity   end close tempCartCursor   deallocate tempCartCursor  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.