本帖最后由 veni2012 于 2012-03-26 17:12:24 编辑

解决方案 »

  1.   

    在表p中就没有na_me这列 应该是这样写的
    select t.name,t.total from (
    select o.acid,p.name,sum(o.amount*p.price) as 
    total from O o left join P p on p.id=o.id 
    group by o.acid,p.name order by total 
    ) t limit 0,3 
    希望对你有用。。如果可以给我写分。。急用要下载东西。
      

  2.   

    我觉得应该是right join P 吧。。因为你要列出的是所有商品,只是取前3个而已,应该 order by total asc limit 0,3.