select (sum(case when a.wtfx='买入' then a.cjje end) -sum(case when a.wtfx='卖出'then a.cjje end)) as hj from amountsum a where a.jjname like '%沪港深%'
合计汇总金额SQl
最新推荐文章于 2023-12-19 20:40:37 发布
select (sum(case when a.wtfx='买入' then a.cjje end) -sum(case when a.wtfx='卖出'then a.cjje end)) as hj from amountsum a where a.jjname like '%沪港深%'