select T.ID,T.VERSION ,T.TITLE ,T.CONTENT ,T.INDEX_KV
,T.CONTENT_PIC ,T.RECOMMEND_TYPE,T.RECOMMEND_PIC
,T.RECOMMEND_URL ,T.PAST_PIC ,T.SHARE_CONTENT ,T.SHARE_PIC
,T.CREATE_DATE ,T.IS_DELETED ,T.STATE ,T.GOOD_FLAG, T.BAD_FLAG,T.PAST_BIG_PIC
from
(select rownum rwno, a.* from flagshop_diagram a where a.is_deleted = 0 and a.state=1 order by id) t
where rwno > 8-4
and rwno < 8
将你的满足条件的全部记录作为一个子查询。然后加上条件ROWNUM<N不行吗 ------解决方案-------------------- 你不是去满足条件的前三条么?
select * (select * from table where ... order by id ) where rownum<=3 ------解决方案-------------------- 内查询换成以下即可:
select row_number() over (order by id) rwno
, a.*
from flagshop_diagram a
where a.is_deleted = 0
and a.state=1