求个两列条件要求最少的sql语句或程序算法 比如a表有字段b和cb c100 2090 3080 2570 4075 3272 1980 19我现在要查的是 c 字段最小, 即是用sql语句把 72 19(红色字段)那列查出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tb_name t1 where not exists (select 1 from tb_name t2 where t2.c<t1.c and t2.b<t1.b) select min(b) as b,c from a where c=(select min(c) from a); 根据楼主的意思先找最小的c,如果最小的c有多个,再找最小的b。sql语句如下:select b,c from a where c=(select min(c) from a) order by b desc limit 1; 如果是这样的话,那得用升序:select b,c from t1 where c=(select min(c) from t1) order by b asc limit1; mysql图形界面问题 求mysql 1000万数据量几十毫秒查询响应 mysql 截取字符串 建立trigger权限不足,求教了 这样写存储过程有错吗!! ASP中怎样可以把记录写入MYSQL中 求一条查询语句 求助——数据库设计,网银账户 为什么总有一些数据库查询语句很长? mysql存储过程支持用表作为参数吗? postgresql 类型转换 mysql event 问题
where not exists (select 1 from tb_name t2 where t2.c<t1.c and t2.b<t1.b)
sql语句如下:select b,c from a where c=(select min(c) from a) order by b desc limit 1;