cmd.CommandText = "Se lect * From (Se lect Row_Number() Over(Order by 订单.订单编号 desc ) As RowNum,订单.订单编号,日期,客户,Sum(数量) As 数量,sum(数量*单价) As 金额"
cmd.CommandText = cmd.CommandText & " From 订单
Left JOIN 订单明细 ON 订单明细.订单编号 = 订单.订单编号 Group By {订单}.订单编号,日期,客户) As a "
cmd.CommandText = cmd.CommandText & " Where RowNum >= " & StartRow & " And RowNum <= " & EndRow
Dim dt As
DataTable = cmd.ExecuteReader
'根据此页数据生成表格
这是高级开发版中帮助中的一段,看不明白为什么要加入这个订单明细, Left JOIN 订单明细 ON 订单明细.订单编号 = 订单.订单编号,不是调取订单表的数据就行了吗?为什么会有订单明细加进来?