select * from table where number in ()语句的特殊用法问题。 数据库中有一个表,表的属性列有:编号(number),日期(date),品质(quality)等等;其中,编号相同的行日期不一样。我想从表中查询出的结果是:编号为1,2,5,其日期分别为自己最近的3条记录,也就是编号为1的最近的3条记录,编号为2的最近3条记录和编号为5的最近的3条记录,请问用select * from table where number in(1,2,5)这种写法怎么才能实现?请不吝赐教! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * (select table.*,rank() over(partition by number order by date desc) rk from table )from where rk<=3 and number in(1,2,5) 晕了...这样也能写错..select * from (select table.*,rank() over(partition by number order by date desc) rk from table )where rk<=3 and number in(1,2,5) select * from (select row_number() over(partition by number order by date desc ) as rn,A.* from A where number in (1,2,5))where rn<=3 oracle数据库备份,文件总大小200多个G,还有什么办法能让备份文件小一点? 如何写一个触发器? 关于“'”的问题,请大家指教 ORACLE中取出表中按照某字段排序的前N条记录,再把这前N条记录删除? 如何终止正在运行的存储过程 oracle网络连接奇怪问题 救命,我实在想不好,如何设计一个社团活动小系统数据库 这样的需求,怎么写SQL语句?高分相送 建立数据库,我想别人建十个库也没有我的问题多 奇怪在DELPHI中调用一个存储过程发生ORA-12571错误 oracle rac恢复问题 急急!!!!!!!!!1 终于生星星了。散200,大家都拿些分,中午节
(select table.*,rank() over(partition by number order by date desc) rk
from table
)
from where rk<=3 and number in(1,2,5)
(select table.*,rank() over(partition by number order by date desc) rk
from table
)
where rk<=3 and number in(1,2,5)
select * from (select row_number() over(partition by number order by date desc ) as rn
,A.* from A where number in (1,2,5))
where rn<=3