今晚很好奇想知道Oracle下有没有APPLY子句?如果有那怎么实现SQL Server下的TOP + APPLY。结果自己写了个例子。

with a as (
select grp_factor from (select distinct grp_factor from numbers where id < 10 order by grp_factor) t 
where rownum <= 5)

select b.id, a.grp_factor
from a cross apply(select id from (select id from numbers b where a.grp_factor = b.grp_factor order by id) t where rownum<=3)b

 

相关文章:

  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2022-01-26
  • 2021-12-29
  • 2022-12-23
  • 2022-01-01
猜你喜欢
  • 2021-08-08
  • 2022-12-23
  • 2022-03-03
  • 2022-12-23
  • 2021-10-03
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案