开发者

I want to deduct a certain amount from a column's data

开发者 https://www.devze.com 2023-02-20 16:39 出处:网络
I want to deduct Rs 300 from totalfee column in every row How do I writ开发者_如何学Goe this as a SQL queryAssuming that you want to modify the actual data

I want to deduct Rs 300 from totalfee column in every row

How do I writ开发者_如何学Goe this as a SQL query


Assuming that you want to modify the actual data

UPDATE yourtable 
SET totalfee =totalfee - 300

If this is just for a select

SELECT totalfee - 300 AS fee_post_deduction 
FROM yourtable

Both of these can give negative fees if you currently have any totalfee values less than 300 of course.

0

精彩评论

暂无评论...
验证码 换一张
取 消