where a.department =b.department 结果:
(15) 查询每种商品的商品编号、商品名称、订货数量和订货单价。 命令:
select b.ProductName ,a.ProductNo ,a.total,a.price from ( select sum(quantity ) as total,ProductNo ,price from OrderDetail group by ProductNo ,price ) as a , Product as b where a.ProductNo =b.ProductNo 结果: