0
我正在做运动分析(沙滩排球),并得到了一张表moves
。举例来说,移动是服务王牌,阻止错误或攻击获胜者(由标签标识)。一个举措可以提高a队,b队的得分或者保持原状。PostgreSQL计算总和和使用结果返回赢家
部分样本moves
数据。
set, tag, points_team_a, points_team_b
---,----,--------------,--------------
1, 520, 1, 0
1, 510, 0, 0
1, 300, 0, 1
1, 410, 0, 0
1, 620, 0, 0
我有一个查询返回整体结果。
select
moves.set,
sum(moves.points_team_a) as team_a,
sum(moves.points_team_b) as team_b
from moves
where match_uuid = '26d41fc6-13d3-4af7-a5a3-3ec21bf06f03'
group by set
这表明team_a
拿下首盘21:12和第二组21:18。
set, team_a, team_b
1, 21, 12
2, 21, 18
是否可以将总体匹配结果(在本例中为team_a为2:0)添加到查询中?
编辑您的问题,并提供样本数据和预期结果。 –