比如a表有字段b和cb     c
100   20
90    30
80    25
70    40
75    32
72    19
80    19我现在要查的是 c 字段最小,  即是用sql语句把  72  19(红色字段)那列查出来

解决方案 »

  1.   

    select * from tb_name t1 
     where not exists (select 1 from tb_name t2 where t2.c<t1.c and t2.b<t1.b)
      

  2.   

    select min(b) as b,c from a where c=(select min(c) from a);
      

  3.   

    根据楼主的意思先找最小的c,如果最小的c有多个,再找最小的b。
    sql语句如下:select b,c from a where c=(select min(c) from a) order by b desc limit 1;
      

  4.   

    如果是这样的话,那得用升序:select b,c from t1 where c=(select min(c) from t1) order by b asc limit1;