参考这个做法 ExecuteValues,如果是最大max,如果最小min
Dim cmd As new SQLCommand cmd.CommandText = "Select Sum(数量) As 数量, Sum(数量 * 单价) As 金额 from {订单} Where 产品 = 'PD01'"Dim Values = cmd.ExcuteValuesIf Values.Count > 0 Then Output.show(Values("数量")) Output.show(Values("金额"))End If