写一个查询,你将减少所有居住在孟买的人的佣金2%。 [英] Write a query where you will decrease the commision by 2% for all people live in mumbai.
本文介绍了写一个查询,你将减少所有居住在孟买的人的佣金2%。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
不知道如何增加和减少sql基本百分比
我尝试过:
sql>从工人中选择通信
其中comm = comm - 2%;
dont know to how to increase and decrease the percentage fundamental in sql
What I have tried:
sql> select comm from workers
where comm = comm - 2%;
推荐答案
使用 SQL UPDATE [ ^ ]
例如,从居住在孟买市的所有人中扣除2%:
Use SQL UPDATE[^]
for example,to deduct 2% from all residing in the city of Mumbai:
UPDATE workers
SET comm=comm*0.98
WHERE city="mumbai"
这样的事情:
Something like this:
select comm * 0.98 from workers where city='mumbai';
这篇关于写一个查询,你将减少所有居住在孟买的人的佣金2%。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文