我想要做的是添加另一个计算的列(cr – dr)
看到你不能在SELECT子句中重用别名,你会怎么去计算总计
SELECT SUM(b.bet_win * cy.fx_rate )as dr,SUM(b.bet_loss * cy.fx_rate ) as cr,cr+dr as total
FROM ....
WHERE ....
最佳答案
我想要做的是添加另一个计算的列(cr – dr)
看到你不能在SELECT子句中重用别名,你会怎么去计算总计
SELECT SUM(b.bet_win * cy.fx_rate )as dr,SUM(b.bet_loss * cy.fx_rate ) as cr,cr+dr as total
FROM ....
WHERE ....