select aa.* from 
b aa ,(select 客户编号,max(金额) from b group by 客户编号) bb
where aa.客户编号=bb.客房编号 and aa.金额=bb.金额

解决方案 »

  1.   

    select a.编号,max(定单字段名) from b where 编号 = (select 编号 from a)
      

  2.   

    select aa.* from 
    b aa ,(select 客户编号,max(数量) from b group by 客户编号) bb
    where aa.客户编号=bb.客房编号 and aa.数量=bb.数量
      

  3.   

    用这个试试
    select aa.* from 
    b aa ,(select 客户编号,max(日期) from b group by 客户编号) bb
    where aa.客户编号=bb.客房编号 and aa.日期=bb.日期