select b.公司名称,sum(c.数量) 数量from 订单 a inner join 运简纳坦货商 b on a.运货商ID=b.运货商ID inner join 茄嫌订单明细 c on a.订单ID=c.订单IDwhere a.发货日期>拦桐='1997-1-1' and 到货日期<='1997-12-31 23:59:59.999'group by b.公司名称