select * from
(select top $endCount$ * from sys_news
where news_type = #newsType# and isdelete=#isdelete#
<dynamic prepend=" and ">
<isNotEmpty prepend=" and " property="title">title like '%$title$%'</isNotEmpty>
</dynamic>
order by create_date desc
) ns
where ns.newsid not in
( select top $startCount$ newsId from sys_news
where news_type = #newsType# and isdelete=#isdelete#
<dynamic prepend=" and ">
<isNotEmpty prepend=" and " property="title">title like '%$title$%'</isNotEmpty>
</dynamic>
order by create_date desc
)
select * from (
select sn.*,rownum r from sys_news sn
where rownum <= $endCount$ and sn.news_type =#newsType# and sn.isdelete=#isdelete#
<dynamic prepend=" and ">
<isNotEmpty prepend=" and " property="title">title like '%$title$%'</isNotEmpty>
</dynamic>
order by create_date desc) where r > $startCount$
二
<![CDATA[
SELECT * FROM (SELECT row_.*, rownum r FROM
(select sn.* from sys_news sn
where sn.news_type =#newsType# and sn.isdelete =#isdelete#
) row_ WHERE rownum <= $endCount$ )row_ WHERE r > $startCount$
ORDER BY create_date desc
]]>
三
select * from (
select sn.*,rownum r from sys_news sn
where rownum <= $endCount$ and sn.news_type ='$newsType$' and sn.isdelete='$isdelete$'
<dynamic prepend=" and ">
<isNotEmpty prepend=" and " property="title">title like '%$title$%'</isNotEmpty>
</dynamic>
order by create_date desc) where r > $startCount$