我的MySQL表类型有3列:、sum和 custom_sum ,其中custom_sum可以是空的,而且我不得不修改查询。SELECT `type`, SUM(`sum`) FROM `localhost-test` GROUP BY `type`
我需要的是,如果custom_sum为空,则在SUM()中使用SUM()和,如果没有,则使用custom_sum。在mysql中可以根
我正在为一个客户的表格工作,他们只想要计算特定的列值,我已经做了一种方法,但这不是他们需要的结果,所以它被放在一边。company_name | type | ................com A | type2 | ................com A | type2 | ................
com A | type