开发者

I want to deduct a certain amount from a column's 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜