mysql - simple SUM query for C# -


i want ask simple sum query. in question, attached picture let guys see table. now, want calculate januari's target + februari's target = februari's target_ytd have got far this

select sum(target) 'target_ytd' revenue bulan = "januari" or bulan = "februari" 

but query above produce final result of calculation, , want is, want put result in "revenue" table (which februari's target_ytd column exactly). appreciate can me figure out. thank you

i suppose revenue table contains column named 'target_ytd' , want update field sum function januari , februari target values

use that

update revenue set target_ytd=(select sum(target) revenue bulan in ('januari', 'februari')) bulan='februari' 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -