碰到一个“分组查询,每组取10条记录”的问题,求解。 表T字段 a、b、c、d、eb为int型条件语句 b in (1,2,3)排序语句 c desc,d asc现在要在b的每种情况下取10条,这查询语句该怎么写。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select *from t txwhere 10>(select count(*) from t where b=tx.b and( c> tx.c or (c=tx.c and d>tx.d)))and b in (1,2,3)order by b,c desc ,d desc 分组取最大N条记录方法征集http://topic.csdn.net/u/20091231/16/2f268740-391e-40f2-a15e-f243b2c925ab.html mysql数据库使用mysqlbinlog工具恢复出错 非常急...求高手帮助 mysql 子查询的表 重复利用 MYSQL数据库打包一定要30M吗 mysql Update时候如何工作的? mysql 中导入的问题 MySql for windows 基本问题 MySQL的最新版本是多少 ,有什么改进,大家用了之后有什么感受,怎么解决事务处理的? 联合索引真的存在吗? 请高手帮忙分析my.ini配置,谢谢! 数据库查询表的所有字段出问题 求写一查询语句 查询用户的二次登陆
from t tx
where 10>(select count(*) from t where b=tx.b and( c> tx.c or (c=tx.c and d>tx.d)))
and b in (1,2,3)
order by b,c desc ,d desc
http://topic.csdn.net/u/20091231/16/2f268740-391e-40f2-a15e-f243b2c925ab.html