How to make Arithmetic operation on mysql DATABASE EASY


Let say we have a table called transaction and differents columns  we want to make this operation montant=500 -100 with the column idtransaction and montant 

Step 1: Write this command in mysql:
update transaction set montant= montant -100 where idtransaction= -1;

The result is: 400

We did a minus operation 500-100 = 400 
in mysql 

Commentaires

Posts les plus consultés de ce blog

Men kijan pou voye MINUT NATCOM-NATCOM pou ZANMIW an 3 etap

Comment partager des minutes sur natcom

Men kijan pou prete kob, minutes, lajan nan men NATCOM Ayiti