近期新接触sqlserver、oracle数据库,发现指定返回记录总数居然都和mysql不同:

  • Mysql:select XXX where XXX limit N
  • Sqlserver: select TOP N XXX
  • Oracle:select XXXX where rownum < (N+1)

注意点:

  1. oracle中,rownum=N,只有N=1为true,其他均为false。因此,如果需要返回N条记录,条件应该为 where rownum < (N+1)
  2. rownum详细用法,见:https://www.cnblogs.com/amyzhu/p/13061834.html

相关文章:

  • 2021-07-27
  • 2021-06-29
  • 2022-02-18
  • 2022-12-23
  • 2022-02-09
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-01
  • 2021-08-14
  • 2022-03-04
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
相关资源
相似解决方案