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
Post a Comment