每个分类挑5个 id(唯一自增)cid(分类id,不唯一)ptime(时间戳)name(其他一些字段)求一个语句,每个分类取出时间最早(按ptime,不按id)的5条记录。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考下贴中的多种方法http://topic.csdn.net/u/20091231/16/2f268740-391e-40f2-a15e-f243b2c925ab.html[征集]分组取最大N条记录方法征集,及散分.... select * from table1 twhere 5>(select count(*) from table1 where cid=t.cid and ptime<t.ptime); select *from tb Awhere 5>(select count(*) from tb where A.cid=cid and A.ptime>ptime) 多个值如何查询成一个字段 存储过程中的update语句不执行 linux下怎么启动mysql mysql 求和 请帮忙 给修改一下 请教mysql在参数查询时的问题? 一个棘手的mysql数据连接问题(时断时连) MySQL 中插入一條紀錄後如何返回auto_increment mysql Access denied for user 'root'@'localhost' (using password: YES) mysql一个库里能放多少张表? 求助,关于数据库报错 在线等,一个字符集的问题 高人指点,我新建的mysql数据库怎么没有默认的函数库啊?
[征集]分组取最大N条记录方法征集,及散分....
where 5>(select count(*) from table1 where cid=t.cid and ptime<t.ptime);
from tb A
where 5>(select count(*) from tb where A.cid=cid and A.ptime>ptime)