select a.*
from 表 a join(
    select 料号,报价=min(报价) from 表 group by 料号
)b on a.料号=b.料号 and a.报价=b.报价

解决方案 »

  1.   

    select a.*
    from 表 a join(
    select a.料号,a.报价,厂商=min(a.厂商)
    from 表 a join(
    select 料号,报价=min(报价) 
    from 表 group by 料号
    )b on a.料号=b.料号 and a.报价=b.报价
    )b on a.料号=b.料号 and a.报价=b.报价 and a.厂商=b.厂商
      

  2.   

    select  a.*  from 表 a left join (select 料号,min(报价) 报价 from 表 group by 料号)b on a.料号=b.料号 and a.报价=b.报价
      

  3.   

    select a.*
    from 表 a join(
    select a.料号,a.报价,厂商=min(a.厂商)
    from 表 a join(
    select 料号,报价=min(报价) 
    from 表 group by 料号
    )b on a.料号=b.料号 and a.报价=b.报价
    )b on a.料号=b.料号 and a.报价=b.报价 and a.厂商=b.厂商