SQLã§ä»¥ä¸ã®ãããªå¦çãããã¦ãã¾ãã select id,売ä¸,å ¥é,(select sum(売ä¸-å ¥é) from t1 where id<=x.id) as ç´¯è¨ from t1 as x order by id ï¼ ãã¼ã¿è¡ãå°ãªãæã¯åé¡ãªãã®ã§ãããå¤ããªãã«ã¤ãæéããããã¾ããææªã¯ã¿ã¤ã ã¢ã¦ããçºçãã¦ãã¾ãã¾ãã ä¸éãã¼ãã«ã使ãæãããã¾ããããã¾ãããããªãã®ã§ãã©ã®ããã«ããã¨é«éå¦çãåºæ¥ãã®ã§ããããï¼ ã¢ããã¤ã¹ãããã ãã¾ãããï¼
{{#tags}}- {{label}}
{{/tags}}