首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

实例应用,该如何处理

2012-03-09 
实例应用写语句将更新bounds的值boundsamount*price*5%想了很久也想不出来。。也写不出来...[解决办法]SQL

实例应用



写语句将更新bounds的值
bounds=amount*price*5%
想了很久也想不出来。。也写不出来...

[解决办法]

SQL code
update Saleset bounds=b.boundsfrom (select ID,sum(amount*price*0.05) as bounds from product group by ID)bwhere Sale.ID=a.ID
[解决办法]
SQL code
update set bounds=b.boundsfrom  Sale a join(select ID,sum(amount*price*0.05) as bounds from product group by ID)bon   a.ID=a.ID 

热点排行