我想要做的是添加另一个计算的列(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 ....
最佳答案
原文链接:https://www.f2er.com/mysql/434082.html我想要做的是添加另一个计算的列(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 ....