我改成这样子,提示信息又变了
with cte as( select a.出库单号, 客户, b.产品, 日期 as 最后订购日期 ,数量 as 订购数量 from 出库 a , 出库明细 b where a.出库单号=b.出库单号)select * from cte twhere not exists(select 1 from cte where 客户=t.客户 and 产品=t.产品 and 最后订购日期>t.最后订购日期)
此主题相关图片如下:bb.jpg
网络上好像有类似的情况
http://www.cnblogs.com/klvk/archive/2010/04/29/1723856.html