如果我有一个包含目标和分钟播放字段的表格,我如何计算每分钟的最高目标?目前我拥有它所以最高的统计数据(无论用户选择哪个)被放入标签以及该特定记录的名字和姓氏。我想做同样的事情,但现在使用使用多个字段的计算。我该怎么做? (以下是我如何做我已经做过的事情)
ElseIf cb_Stat.Text = "Most Assists" Then
SQL = "SELECT TOP 1 * FROM PlayerDatabase ORDER BY Assists DESC"
Dim da As New OleDbDataAdapter(SQL, Connection)
da.Fill(ds, "PlayerDatabase")
lbl_Result.Text = cb_Stat.Text & ": " & ds.Tables("PlayerDatabase").Rows(0).Item(2) & " " & ds.Tables("PlayerDatabase").Rows(0).Item(1) & " (" & ds.Tables("PlayerDatabase").Rows(0).Item(7) & ")"
答案 0 :(得分:0)
两种方法:
select goals, minutes, round(goals/minutes,2) gpm --edit last digit for number of decimal places
from PlayerDB
order by goals/minutes
或者这个。它有点长,但更清洁,可以合并到视图中
select * from (
select goals, minutes, round(goals/minutes,2) gpm --edit last digit for number of decimal places
from PlayerDB
) order by gpm