SELECT userid,
Round((totalhold - playercomps - freemoney - (depositmade_amt*.1)),2) as SpecValue, txndate
FROM player_activity
WHERE userid = 2026939
GROUP BY month(txndate)
理想情况下,我会计算每个月此用户的价值。但是,我的查询只返回每个月的第一个值。例如,如果June有3个SpecValues(10,20,30),我的查询只返回第一个SpecValue(10)。
帮助?
答案 0 :(得分:0)
SELECT userid,
Sum(Round((totalhold - playercomps - freemoney - (depositmade_amt*.1)),2)) as SpecValue, txndate
FROM player_activity
WHERE userid = 2026939
GROUP BY month(txndate)