"SELECT DISTINCT CustNo, SUM( ItemsTotal )ItemsTotalAll,SUM( Freight ) FreightAll, SUM( AmountPaid ) AmoutPaidAll FROM Orders GROUP BY CustNo ORDER BY
CustNo",DataSource和Params属性均为空,产生M/D关系中的主表;QueryDetail的的SQL属性设为:"Select OrderNo,CustNo,PaymentMethod,ItemsTotal,TaxRate,Freight,AmountPaid From Orders Where Orders.CustNo = :CustNo",DataSource属性为DataSourceMaster,指向主表;Params属性以CustNo关联字段作参数。相应的,DataSourceMaster和DataSourceDetail的DataSet属性分别指向QueryMaster和QueryDetail。