我单独更新查询hoqw [英] i single update query hoqw

查看:73
本文介绍了我单独更新查询hoqw的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Empid工资



101 5000

102 6000

103 8000





i希望将薪水更新为所有Empid的50%。

单次更新如何将薪水更新为50% 。





我的输出如下



Empid salary



101 2500

102 3000

103 4000





如何在sql server中使用单个更新查询。

解决方案

尝试:

 更新 MyTable  SET 薪水=薪水/  2  


Empid salary

101 5000
102 6000
103 8000


i want to update the salary to be 50% of all the Empid.
in single update how to update the salary to 50%.


My output as follows

Empid salary

101 2500
102 3000
103 4000


how can i do in sql server using single update query.

解决方案

Try:

UPDATE MyTable SET Salary = Salary / 2


这篇关于我单独更新查询hoqw的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆