SQL查询语句
我的表中有一亿对条记录。
我怎么快速查询出我想要的呢?
select id,center_id from (select rownum countnum, t.* from (select * from table_name ) where rownum <= 50000) where countnum>5000
上面的语句还能优化(提高速度)吗
我的表中有一亿对条记录。
我怎么快速查询出我想要的呢?
select id,center_id from (select rownum countnum, t.* from (select * from table_name ) where rownum <= 50000) where countnum>5000
上面的语句还能优化(提高速度)吗
(SELECT id,center_id ,row_number() OVER(ORDER BY id) rownumber FROM table_name)
where rownumber > 5000 and rownumber <= 50000;
where countnum<= 50000 and countnum>5000
(select id,center_id,rownum c from table_name where rownum <= 50000)
where c>5000
select id,center_id from table_name
where rowid in
(
select rid from
(
select rowid rid,rownum rm from table_name
where rownum<50000
)
where rm>5000
);