求:帮我将这条SQL语句转成HQL...
updategoodssetprice=(selectsum(price)fromio_goodswhereio_goods.goodsid=777)wheregoods...
update goods set price = (select sum(price) from io_goods where io_goods.goodsid=777) where goods.goods_id=777;
请问一下求差语句怎么弄.
select sum(price) from io_goods where io_goods.goodsid=777 and io_goods.ioless=0;
select sum(price) from io_goods where io_goods.goodsid=777 and io_goods.ioless=1;
将上面select 出来的两个值相减? 将0的减去1的.. 展开
请问一下求差语句怎么弄.
select sum(price) from io_goods where io_goods.goodsid=777 and io_goods.ioless=0;
select sum(price) from io_goods where io_goods.goodsid=777 and io_goods.ioless=1;
将上面select 出来的两个值相减? 将0的减去1的.. 展开
2个回答
展开全部
select top 1 ((select sum(price) from io_goods where io_goods.goodsid=777 and io_goods.ioless=0)-(select sum(price) from io_goods where io_goods.goodsid=777 and io_goods.ioless=1)) as 求差 from io_goods
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询