select a.商品编号, ISNULL(b.进货数量, 0) 进货数量, ISNULL(b.进货金额, 0) AS 进货金额, ISNULL(c.销售数量, 0) AS 销售数量, ISNULL(c.销售金额, 0) AS 销售金额 from 商品表 LEFT OUTER JOIN (select 商品编号, sum(进货数量) AS 进货数量, sum(进货金额) AS 进货金额 from 进货表 group by 商品编号) b ON a.商品编号=b.商品编号 LEFT OUTER JOIN (select 商品编号, sum(销售数量) as 销售数量,sum(销售金额) as 销售金额 from 销售表 group by 商品编号) C on a.商品编号=c.商品编号如果是SQL SERVER数据库的话,就是这条语句,如果是ORACLE数据库就把外连接改一下就好。我发现用DELPHI的人很多都是操作SQL SERVER数据库。