SQL加总问题

SQL加总问题,sql,Sql,我希望在一个SQL查询中找到数量的总和,并将其除以当前数量。 例如: 总和(数量)=5,所以我想用公式计算分数。2/5和3/5 ID Title Qty 1 BMW 2 2 VW 3 这应该行得通 ID title newscores 1 BMW 2/5 1 vW 2/5 这应该行得通 ID title newscores 1 BMW 2/5 1 vW 2/5 这应该行得通 ID title newscores 1 BMW 2/5 1

我希望在一个SQL查询中找到数量的总和,并将其除以当前数量。 例如:

总和(数量)=5,所以我想用公式计算分数。2/5和3/5

ID Title Qty

1  BMW   2

2  VW    3
这应该行得通

ID title newscores
1  BMW   2/5
1  vW    2/5
这应该行得通

ID title newscores
1  BMW   2/5
1  vW    2/5
这应该行得通

ID title newscores
1  BMW   2/5
1  vW    2/5
这应该行得通

ID title newscores
1  BMW   2/5
1  vW    2/5

注:不需要GROUPBY子句

select id, title, qty/(select sum(qty) from make)
from make

注:不需要GROUPBY子句

select id, title, qty/(select sum(qty) from make)
from make

注:不需要GROUPBY子句

select id, title, qty/(select sum(qty) from make)
from make

注:不需要GROUPBY子句

select id, title, qty/(select sum(qty) from make)
from make