select distinct 店铺名称,发货时间,订单编号,买家ID,姓名,电话,sum(cast(实际售价 as float)) as 实际售价,sum(数量) as 总数量 from xlcxs where 发货时间 = '2014.01.07' group by 订单编号,店铺名称,发货时间,买家ID,姓名,电话
select distinct 店铺名称,发货时间,订单编号,买家ID,姓名,电话, sum(cast(实际售价 as float)) as 实际售价,sum(数量) as 总数量, (select 运费 from xlcsh b where a.订单编号=b.订单编号) from xlcxs a where 发货时间 = '2014.01.07' group by 订单编号,店铺名称,发货时间,买家ID,姓名,电话